-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Imported files outside the source directory built when changed in watch mode #2491
Comments
pr submitted |
I think I may be seeing a related issue. My command:
has started hanging. If I run the same command without the I'm sorry I can't be more precise here. If you can give me a hint how I can diagnose this more effectively I'm happy to do this.
node-sass 4.9.3 (Wrapper) [JavaScript]
libsass 3.5.4 (Sass Compiler) [C/C++]``` |
@swervo if you point |
@paulcpederson I tried that. It's the same. I think I am seeing a different problem.
Apologies if I've taken you off track. |
I have a fix for this, will try to pr shortly. It's kind of an edge case, but replication is fairly straight forward.
Assume we have the following file tree:
And
file1
imports the library, like this:We build all the sass files in
src/
with the CLI usingnode-sass src/ -o dist/
. This works correctly.If, we watch for changes and change the files in
src
, it also still works correctly.But if we change
library/include.scss
, the CLI will build a new file atlibrary/include.css
. Then, node-sass will throw an error:Even though it is outside the source directory, it's included in the watched files, and because it doesn't have an underscore preceding it's name, we render it to the default location (right next to itself).
The fix is pretty simple, basically when using a directory for multiple file compilation, when files change, check that they are actually inside the directory before rendering. I added multiple file compilation once upon a time so this is mostly my fault 😬 I'll try to get a pr for this fix in soon.
npm -v
): 6.4.0node -v
): v8.2.1node -p process.versions
):node -p process.platform
): darwinnode -p process.arch
): x64node -p "require('node-sass').info"
):npm ls node-sass
): node-sass@4.9.3The text was updated successfully, but these errors were encountered: