0

试图学习咕噜声。我已经安装了grunt-contrib-compassgrunt-contrib-watch插件。当我grunt在终端中使用时,它会运行指南针任务并返回

Running "compass:dist" (compass) task
Compass can't find any Sass files to compile.
Is your compass configuration correct?.
If you're trying to start a new project, you have left off the directory argument.
Run "compass -h" to get help.`

Gruntfile 在wp-content/我的 Wordpress 安装文件夹中。这是我的 Grunfile 中的指南针设置:

compass: {
    dist: {
        options: {
            config: 'themes/THEME-NAME/config.rb',
            force: true
        }
    }
},

我的 config.rb 在那里,并因此设置:

require 'singularitygs'
require "breakpoint"
http_path = "/"
css_dir = "/"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
output_style = :compressed
line_comments = false

有任何想法吗?我哪里出错了?

4

4 回答 4

4

我也遇到了这个问题,您不必更改 config.rb 中的 css 或 sass 目录路径,您只需basePath在 Gruntfile.js 中设置 - 这告诉 compass 从哪里运行,否则默认为同一目录作为你的 Grunfile,这显然是错误的。

文档在这里:https ://github.com/gruntjs/grunt-contrib-compass

compass: {
  uikit: {
    options: {
      config: 'styles/uikit/config.rb',
      basePath: 'styles/uikit',
      bundleExec: true
    }
  }
}
于 2014-12-07T21:03:47.997 回答
1

APPARENTLY when you use a config.rb in another directory, set your config.rb's variable paths relative to the Gruntfile's directory and it should all work.

于 2014-09-07T02:07:51.177 回答
0

当我想使用 Susy 工具包时,我的第一个 sass 项目也有这个问题。你应该从你的工作目录中输入“compass watch”命令,剩下的就交给罗盘了。然后编译 main.scss 文件。如果显示如下...

modified C:/xampp/htdocs/projects/sass/config.rb
clean C:/xampp/htdocs/projects/sass/css
delete C:/xampp/htdocs/projects/sass/css/main.css
write C:/xampp/htdocs/projects/sass/css/main.css

然后它的工作。但首先,您必须配置 config.rb 文件。

于 2018-05-14T07:30:17.493 回答
-4

这个:

 sudo npm install --save-dev
于 2015-03-03T14:39:46.620 回答