gruntjs / grunt-contrib-watch

Run tasks whenever watched files change.
http://gruntjs.com/
MIT License
1.98k stars 356 forks source link

grunt-contrib-sass and livreload - must save twice to trigger css soft reload #533

Open sinrise opened 7 years ago

sinrise commented 7 years ago

Following the example in the documentation "Live Reload with Preprocessors", it does work but you must actually save the file twice to trigger a css "soft" reload. I think this is because Grunt can only run one task at time? If you save once, it runs the sass precompiler and quits. Then a subsequent save triggers the livereload since there aren't any changes to the sass stack. The only difference between my gruntfile.js and the example code references above is I have a scss file specified in src (in the sass directive). I have a single file: main.scss that loads all of my other scss partials via @import (pretty standard, right?). I tried using an asterisk but it totally blew up my stylesheets. It's strange the example would use *.sass as a source and a single index.css file as the dest. How is the preprocessor supposed to figure that out? I'm not sure if the two issues are related.

moraleslevi commented 7 years ago

I am also seeing this. Have downgraded to 0.6.0 as that seems to be the last version without this issue.