gruntjs / grunt-contrib-sass

Compile Sass to CSS.
http://gruntjs.com/
MIT License
849 stars 142 forks source link

loadPath doesn't find node_modules package #236

Open chenasraf opened 7 years ago

chenasraf commented 7 years ago

I'm not sure what I'm doing wrong - I have a .scss file like this:

//// Start Bootstrap
// Core variables and mixins
@import "bootstrap/variables";
@import "bootstrap/mixins";

// Reset and dependencies
@import "bootstrap/normalize";
@import "bootstrap/print";
@import "bootstrap/glyphicons";

// Core CSS
@import "bootstrap/scaffolding";
@import "bootstrap/type";
@import "bootstrap/code";
@import "bootstrap/grid";

// Utility classes
@import "bootstrap/utilities";
@import "bootstrap/responsive-utilities";
@import "bootstrap/tooltip";
//// End Bootstrap

And then my Gruntfile looks like this:

sass: {
      dist: {
        options: {
          style: 'expanded',
          loadPaths: ['node_modules/bootstrap-sass/assets/stylesheets/'],
          require: 'bootstrap-sass' // tried with/without
        },
        files: {
          'dist/css/app.css': 'src/sass/app/app.scss',
        }
      }
    }

But when attempting to compile I get the following error:

>> Error: File to import not found or unreadable: bootstrap/variables.
>>        Parent style sheet: <path>/src/sass/<file>.scss
>>         on line 3 of src/sass/<file>.scss
>> >> @import "bootstrap/variables";
>>    ^
Warning:  Use --force to continue.

Aborted due to warnings.

What am I doing wrong? I checked the path and it is indeed valid, so I'm not sure why this would happen. I also tried adding file extensions and underscores to the import but it didn't work.

andrejpavlovic commented 6 years ago

The correct option name seems to be "includePaths", not "loadPath".