Search code examples
sassgulp

Importing SASS partials from node_modules


Trying to build custom workflow with gulp, panini, mustache, sass and one of my problem is including partials from node_modules, here is example from main.scss file:

@import "node_modules/bootstrap/scss/mixins";
@import "settings";

How to avoid typing full path to _mixins.scss?


Solution

  • Your question is similar to this: Sass import not crawling node_modules to find appropriate package

    You can include paths by passing the includePaths argument to gulp sass. e.g

    .pipe($.sass({
      includePaths: ['node_modules/bootstrap/scss/', 'another/path']
    })