【问题标题】:Setting up grunt-contrib-sass with node-bourbon使用 node-bourbon 设置 grunt-contrib-sass
【发布时间】:2013-12-15 00:06:15
【问题描述】:

我正在尝试将 bourbon 作为依赖项添加到使用 grunt-contrib-sass 的项目中。 node-bourbon 对 grunt 和 Sass 的集成有以下看法:

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'
      }
    }
  }
});

但是,运行 grunt 时出现以下错误:

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

这个错误出现在includePaths 的任何路径数组中,而不仅仅是波旁威士忌。

我做错了什么?

【问题讨论】:

    标签: javascript node.js sass gruntjs bourbon


    【解决方案1】:

    node-bourbon 使用的是grunt-sass 而不是grunt-contrib-sass。这就是该选项不可用并且您收到此错误的原因。

    因此,要么交换这两个繁重的任务,要么将 includePaths 替换为 loadPath。这是grunt-contrib-sass 中的等效选项。

    【讨论】:

      猜你喜欢
      • 2014-01-25
      • 1970-01-01
      • 1970-01-01
      • 2023-03-12
      • 2017-10-15
      • 2014-05-27
      • 2016-09-05
      • 2016-04-08
      • 2014-04-16
      相关资源
      最近更新 更多