简体   繁体   中英

Setting up grunt-contrib-sass with node-bourbon

I am trying to add bourbon as a dependency to a project where grunt-contrib-sass is used. node-bourbon has the following to say about grunt and Sass integration:

grunt.initConfig({
  sass: {
    dist: {
      options: {
        // THIS IS THE LINE I ADDED TO MY CONFIG
        includePaths: require('bourbon').includePaths,
        outputStyle: 'compressed'
      },
      files: {
        'path/to/output.css': 'path/to/input.scss'
      }
    }
  }
});

However, when running grunt I get the following error:

OptionParser::InvalidOption: invalid option: --include-paths

This error appears with any array of paths given to includePaths , not just bourbon.

What am I doing wrong?

node-bourbon is using grunt-sass rather than grunt-contrib-sass . That's why the option isn't available and you get this error.

So either swap those two grunt tasks or replace includePaths with loadPath . That's the equivalent option in grunt-contrib-sass .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM