【问题标题】:Grunt+Foundation: css/foundation.css created, content [object Object]Grunt+Foundation:创建css/foundation.css,内容[object Object]
【发布时间】:2015-04-08 20:22:57
【问题描述】:

我刚开始使用 Bolt.cm (CMS),它与 ​​Foundation for frontend 一起提供。

我已经安装了 Node、NPM、Node-sass、Bower 和 Grund,并在主题目录中启动了“grunt watch”。

Grunt 正在运行(“等待”),当我在 scss 文件夹中编辑一个文件(当然是来自主题的文件,而不是来自 bower_components,我知道我不应该编辑它们)任务成功执行:

运行“sass:dist”(sass)任务。

文件“css/foundation.css”已创建。

完成,没有错误。

主题和版本:

问题

当我打开 css/foundation.css 时,该文件不包含 CSS 代码,而只有 [object Object] 作为文本。

这是我运行grunt --verbose时的输出:

grunt --verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK

Registering "grunt-sass" local Npm module tasks.
Reading /var/www/bolt/theme/avoe/node_modules/grunt-sass/package.json...OK
Parsing /var/www/bolt/theme/avoe/node_modules/grunt-sass/package.json...OK
Loading "sass.js" tasks...OK
+ sass

Registering "grunt-contrib-watch" local Npm module tasks.
Reading /var/www/bolt/theme/avoe/node_modules/grunt-contrib-watch/package.json...OK
Parsing /var/www/bolt/theme/avoe/node_modules/grunt-contrib-watch/package.json...OK
Loading "watch.js" tasks...OK
+ watch
Loading "Gruntfile.js" tasks...OK
+ build, default

No tasks specified, running default tasks.
Running tasks: default

Running "default" task

Running "build" task

Running "sass" task

Running "sass:dist" (sass) task
Verifying property sass.dist exists in config...OK
Files: scss/foundation.scss -> css/foundation.css
Options: includePaths=["bower_components/foundation/scss"], outputStyle="compressed", sourceComments="none"
Writing css/foundation.css...OK
File "css/foundation.css" created.

【问题讨论】:

    标签: gruntjs zurb-foundation grunt-contrib-watch


    【解决方案1】:

    我设法通过进入 node_modules 文件夹、删除并重新安装 grunt-sass 和 node-sass 来解决此问题:

    rm -rf node-sass rm -rf grunt-sass npm install node-sass npm install grunt-sass

    重新安装 grunt sass 更新了我的foundation-libsass-template repo,我认为这可能是问题所在。

    可能你甚至不需要接触 node-sass,所以不妨先试试 grunt-sass。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-12-01
      • 2023-04-09
      • 1970-01-01
      • 2015-04-27
      • 1970-01-01
      • 1970-01-01
      • 2013-05-05
      相关资源
      最近更新 更多