Current behavior
Suggested behavior
When using directory input with --watch, we should watch .scss files only.
npm -v): 3.10.3node -v): 6.3.1node -p "require('node-sass').info"): 3.10.1resolved?
if the issue still open it's not resolved.
Only watching SASS/SCSS files appears to be in the current code https://github.com/sass/node-sass/blob/master/bin/node-sass#L135
Nevermind, it looks like the watcher does look for css here https://github.com/sass/node-sass/blob/master/bin/node-sass#L243
This looks like a bug I introduced in https://github.com/sass/node-sass/pull/1078. We should not be watching .css files.
Is there a workaround for this bug?
hey @xzyfer could you just make these extensions to be configurable so I can remove css from that lis as a workaround for this issue. Should I create PR for that?
They cannot be configured. They live in LibSass. The decisions has been made to keep the current behaviour until Sass 4's module system is ready. Removing this now will break lots of people's code.
This bug sort of causes infinite compiles to happen when you watch a directory because after SCSS files compile to CSS, the watcher detects changes and recompiles the CSS which starts a vicious cycle Perhaps a recommendation in the documentation for using a different directory for your CSS files from your SCSS files since it's unusable in the current form.
Looks like the best workaround is to use node-sass-chokidar.
So I think the reasonable workaround for this is for node-sass to not treat .css as entry points.
We still need to watch .css files, this is unavoidable with breaking things for users, but we should only trigger compilations for CSS files that are imported by scss files.
This is a patch I think wen can ship before the 5.0 bump and should fix the majority of issues around watching css files.
@xzyfer is this still planned for a pre-5.0 patch?