Yeoman:在更改SCSS文件时触发LiveReload [英] Yeoman: Triggering LiveReload on change of SCSS files
问题描述
我拥有最新的yeoman堆栈,并且我刚刚按照如下方式将generator-webapp升级为master: https://github.com/yeoman/generator-webapp/pull/67 ,以使livereload正常工作。
I've got the latest yeoman stack, and I just upgraded generator-webapp to master as per: https://github.com/yeoman/generator-webapp/pull/67 to get livereload working properly.
HTML文件和CSS文件似乎可以使用livereload正常工作,但是scss文件不会触发重新加载。以下是输出的摘要:
HTML files and css files seem to be working with livereload just fine, but scss files don't trigger a reload. Here's a snippet of output:
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中具有以下内容。
The scss file is being watched and compiled, but it looks as though the outputted css in .tmp is being ignored. This is despite the following in the (default) 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上,但是很难知道
I would post this as a bug on github, but it's difficult to know which part of the stack is responsible.
推荐答案
尝试设置
watch: {
options: {
nospawn: false
}
}
让我知道这是否可行!
这篇关于Yeoman:在更改SCSS文件时触发LiveReload的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!