Press "Enter" to skip to content

How to have multiple includePaths with Grunt Sass

grunt-sass

sass: {
    dev: {
        files: {
            'src/css/styles.css': 'src/scss/styles.scss'
        },
        options: {
            includePaths: require('node-bourbon').includePaths.concat(require('node-neat').includePaths),
        }
    }
}

grunt-contrib-sass


sass: {
    dev: {
        files: {
            'src/css/styles.css': 'src/scss/styles.scss'
        },
        options: {
            loadPath: require('node-bourbon').includePaths.concat(require('node-neat').includePaths),
            sourceMap: true
        }
    }
}

The includePaths (or loadPath with grunt-contrib-sass) property takes an array of different string paths. Doing `require(‘node-bourbon’).includePaths` by itself returns an array so to have multiple includePaths concatenation is required to keep that single array.

Leave a Reply

Your email address will not be published. Required fields are marked *