问题
I've seen many examples for watching a specific folder with node-sass
, but my css isn't all in the same single folder. I'd like to have it watch all subdirectories for scss files the way you can with onchange
(just for example). I'd assume that the syntax would be something like:
`node-sass -w app/**/*.scss -o app/**/`
...but that yields the error: Error: ENOENT: no such file or directory, lstat 'app/**/*.scss'
Is what I'm trying to do even possible with node-sass
? If not, is there a better way to mass-compile my scss files to css? I'm trying to stick to just npm scripts for my build if possible.
回答1:
Try node-sass -rw app -o app
.
You might want to change your output folder as this might keep looping.
Source:
-r, --recursive Recursively watch directories or files https://github.com/sass/node-sass
来源:https://stackoverflow.com/questions/39879674/watch-all-sub-directories-with-node-sass