5

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.

natchiketa
  • 5,867
  • 2
  • 28
  • 25
Paul Odeon
  • 4,407
  • 1
  • 37
  • 37
  • If you find your own answer please post. I installed this stack on a new machine and scss is not working for me either. – Tony Topper Jun 05 '13 at 22:42

1 Answers1

10

Try setting

watch: {
  options: {
    nospawn: false
  }
}

Let me know if this does the trick!

Stephen
  • 5,710
  • 1
  • 24
  • 32
  • That seems to have worked! According to the docs it does slow it down, and it's not really clear to me why it does what it does, but it works... – Paul Odeon Jun 07 '13 at 17:54
  • 3
    Great! Since `watch.livereload.files` is bound to the `.css` compiled result of the `watch.compass` task, it requires an extra step to see that the compiled file has changed. – Stephen Jun 07 '13 at 18:21
  • Thanks! This worked for me as well. Now LiveReload is seeing when I save a change to any of the `.scss` files in my project (well, the ones compass is watching, anyway). – natchiketa Jun 24 '13 at 00:22
  • Thanks @Stephen. This was driving me crazy. What is weird though is one day generating an app with yeoman it would work fine. The next day it didn't. – pelachile Jun 30 '13 at 00:31