Yeoman:在更改SCSS文件时触发LiveReload

时间:2013-06-05 21:58:03

标签: sass compass-sass yeoman livereload

我有最新的yeoman堆栈,我刚刚将generator-webapp升级为master:https://github.com/yeoman/generator-webapp/pull/67以使livereload正常工作。

HTML文件和css文件似乎正常使用livereload,但scss文件不会触发重新加载。这是一个输出片段:

OK
>> File "app/index.html" changed.


Running "watch" task
... Reload app/index.html ...
... Reload app/index.html ...
Completed in 0.005s at Wed Jun 05 2013 22:45:46 GMT+0100 (BST) - Waiting...
OK
>> File "app/styles/main.scss" changed.


Running "compass:server" (compass) task
overwrite .tmp/styles/main.css 

Running "watch" task
Completed in 1.101s at Wed Jun 05 2013 22:45:57 GMT+0100 (BST) - Waiting...

正在监视和编译scss文件,但看起来好像忽略了.tmp中输出的css。尽管在(默认)Gruntfile中有以下内容。

        livereload: {
            options: {
                livereload: LIVERELOAD_PORT
            },
            files: [
                '<%= yeoman.app %>/*.html',
                '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
            ]
        }

我会将此发布为github上的错误,但很难知道堆栈的哪个部分负责。

1 个答案:

答案 0 :(得分:10)

尝试设置

watch: {
  options: {
    nospawn: false
  }
}

让我知道这是否有效!