node-sass icon indicating copy to clipboard operation
node-sass copied to clipboard

when watching entire directory, don't rebuild files outside said directory

Open paulcpederson opened this issue 7 years ago • 3 comments

#2491 - small fix to the CLI so that non-underscored files outside the watched directory (but imported as part of the tree) are not built.

@xzyfer I've written a test for this with a fixture but skipped it as it looks like you're skipping most of the async tests? Let me know if you want me to add that back in to the list.

paulcpederson avatar Sep 10 '18 20:09 paulcpederson

/cc @Gwerlas

paulcpederson avatar Sep 19 '18 00:09 paulcpederson

@nschonni do you know who could take a look at this?

paulcpederson avatar Mar 06 '19 00:03 paulcpederson

It looks to me that https://github.com/sass/node-sass/issues/2491 https://github.com/sass/node-sass/issues/2504 https://github.com/sass/node-sass/issues/2560 and partially https://github.com/sass/node-sass/issues/2479 have the similar root cause.

We constantly maintain a graph of dependencies and we try to rebuild everything on that graph that does not start with underscore.

This is probably not correct - we should maintain two trees:

  • dependency graph
  • expanded original input specification

We should react to all events on the dependency graph, but only files on the original input specification should ever be compiled.

Looking at that code:

https://github.com/sass/node-sass/blob/8d0accabd61ee5cb16248474f2989209b6200e50/bin/node-sass#L248-L252

we should not fire compilation of the changed file as a response to the changed event - only affected original files should be subjected to rendering.

Any thoughts @xzyfer , @nschonni ? If yes, this would mean a major change in our watching code.

saper avatar Oct 17 '19 23:10 saper