【问题标题】:Compass can't find any Sass files to compile when running gruntCompass 在运行 grunt 时找不到任何要编译的 Sass 文件
【发布时间】:2016-01-27 01:31:41
【问题描述】:

我做了一个繁重的任务来运行罗盘,如下所示:

module.exports = {
      dev: {
          options: {
              sassDir: ['**/*.scss'],
              cssDir: 'stylesheets',
              noLineComments: false,
              outputStyle: 'compressed'
          }
      }
     }

我的watch任务如下:

module.exports = {
   jade: {
      files: 'app/views/**/*.jade',
      tasks: ['jade']
    },
     src: {
        files: '**/*.scss',
         tasks: ['compass:dev']
    },
           options: {
                livereload: true,
            },
}

但是我得到Compass can't find any Sass files to compile.

我的文件夹结构如下:

scss/
stylesheets/
Gruntfile.js
grunt/
  aliases.yaml
  compass.js
  watch.js

【问题讨论】:

  • 你确定这是 sassDir 的正确格式吗?如果这应该是针对 Compass 的,那么值不应该是这样的。
  • 你有 config.rb 文件吗?
  • 不需要吗? @AlvaroJoao 谢谢
  • 谢谢,但我需要更改代码中的任何内容吗? soes config.rb 必须放在哪里? @AlvaroJoao

标签: sass gruntjs compass


【解决方案1】:

您可以在与 gruntfile.js 相同的级别中创建一个名为 config.rb 的文件** Reference

然后你可以知道指南针在哪里寻找 sass 文件:

css_dir = 'assets/stylesheets' #where find the css 
sass_dir = 'assets/sass' #where find sass files
images_dir = 'assets/images' #where find the images (if you want to use then in css as well)

您无需更改代码。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-02-14
    • 2018-11-21
    • 2013-09-08
    • 2017-06-04
    • 2014-11-20
    • 1970-01-01
    • 2015-11-24
    • 2015-01-02
    相关资源
    最近更新 更多