Originally created by: francoismassart
I have several npm scripts defined inside my package.json
:
"css-compile": "node-sass public/static/scss/ -o public/static/css --recursive --output-style expanded --include-path ./node_modules/private-scss/ --include-path ../../ --precision 6",
...
"css-watch": "npm run css-compile -- --watch",
npm run css-watch
is fast and works fine but if I add a new file demo.scss
inside the watched folder public/static/scss/
, the new file demo.scss
never gets compiled, even after several saves and changes...
If I restart the watch, and then save again my new scss file, it compiled.
Is this normal ?
Thank you
Node Process:
{ http_parser: '2.7.0',
node: '4.7.0',
v8: '4.5.103.43',
uv: '1.9.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
icu: '56.1',
modules: '46',
openssl: '1.0.2j' }
- Node Platform: darwin
- Node architecture: x64
- node-sass version:
node-sass 4.7.2 (Wrapper) [JavaScript]
libsass 3.5.0.beta.2 (Sass Compiler) [C/C++]
- npm node-sass versions: └── node-sass@4.7.2
Originally posted by: francoismassart
It is pretty much like the watch is applied to the existing scss files in the directory rather than to the folder and its (to be created) files...
Originally posted by: francoismassart
I could use another watcher utility like
nodemon
in order to trigger a compile script but it would re-compile all thescss
files instead of just compiling the files affected by the latest save operation.The
watch
option fromnode-sass
works great for re-compiling only the affected files but how to make it take into account new files ?compass
'watch
did it right (slooow but right)!Originally posted by: francoismassart
I believe the issue comes from the fact that you use
gaze
by providing a list of files instead of a glob pattern. I guess this offers better performances but does not "watch" for new files outside of the list generated when the script is started.Maybe one solution would be to start a second instance of
gaze
when watching on entire directory.This second instance would only report new files added and pass them to our own watcher which would add it to the "non glob" list of the first
gaze
instance...BTW I updated to
node-sass
v4.8.1
but I still get an error while watching and deleting ascss
file.Originally posted by: davismj
Also have seen this in 4.8.3.
Originally posted by: francoismassart
In order to fix this issue prior to the release of
v5
, I did usechokibar
to watch myscss
folder and trigger the "entire" compilation of myscss
files...