Watch all sub directories with node-sass

不想你离开。 提交于 2020-08-06 02:58:33

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!