Yeoman: Triggering LiveReload on change of SCSS files

坚强是说给别人听的谎言 提交于 2019-12-20 14:45:13

问题


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 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...

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}'
            ]
        }

I would post this as a bug on github, but it's difficult to know which part of the stack is responsible.


回答1:


Try setting

watch: {
  options: {
    nospawn: false
  }
}

Let me know if this does the trick!



来源:https://stackoverflow.com/questions/16950612/yeoman-triggering-livereload-on-change-of-scss-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!