Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
includePaths used with node-grunt is currently used incorrectly in Gruntfile.js
It currently is used as if require('node-bourbon').includePaths will return a single path, but instead it returns an array of paths (one path).
includePaths: ['<%= global_vars.theme_scss %>', require('node-bourbon').includePaths]
On the node bourbon page it recommends to use it as shown here:
var sass = require('node-sass')
, bourbon = require('node-bourbon').includePaths;
var paths = ['other/path', 'another/path'].concat(bourbon);
sass.render({
file: './application.scss',
success: function(css){
console.log(css);
},
error: function(error) {
console.log(error);
},
includePaths: paths,
outputStyle: 'compressed'
});
Where the contents of includePaths is concatenated on the array of other include paths.
Comment | File | Size | Author |
---|---|---|---|
#6 | zurb-foundation-fix-bourbon-2212527-4.patch | 638 bytes | westwesterson |
Comments
Comment #1
westwesterson CreditAttribution: westwesterson commentedComment #2
westwesterson CreditAttribution: westwesterson commentedI solved this locally, by replacing
require('node-bourbon').includePaths
withrequire('node-bourbon').includePaths[0]
but I don't think this is the most elegant solution.Comment #3
westwesterson CreditAttribution: westwesterson commentedThis is still broken, lets review the patch, and get this in core, otherwise grunt breaks!
Comment #4
kevinquillen CreditAttribution: kevinquillen commentedWhere is the patch?
Comment #5
kevinquillen CreditAttribution: kevinquillen commentedAlso what error are you getting? I am not getting one.
Comment #6
westwesterson CreditAttribution: westwesterson commentedIncluding patch now, looks like i forgot to make one earlier.
To reproduce the error, try to use grunt watch. For me it was not working without the fix.
The fix is needed because
require('node-bourbon').includePaths
is an array of one item. This array is being embedded in the includePaths options array. Which makes a 2 level array, which the include paths option cannot handle.as is the array looks like this
The fix is to make it so that instead it handles like this
Comment #7
westwesterson CreditAttribution: westwesterson commentedif for some reason grunt is working for you, id be surprised if bourbon did... try using a mixin from the bourbon library.
Comment #9
shauntyndall CreditAttribution: shauntyndall commentedI've adjusted the gruntfile in the 5.x-dev branch what I believe to be an "elegant" fashion. However, I'm really not able to replicate the grunt issues being described. So, this could still be a valid issue. Please reopen if so.