使用 node-sass 查看所有子目录 [英] Watch all sub directories with node-sass

查看:91
本文介绍了使用 node-sass 查看所有子目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到许多使用 node-sass 观看特定文件夹的示例,但是我的 css 并不都在同一个文件夹中.我想让它以您可以使用 onchange 的方式查看 scss 文件的所有子目录(仅作为示例).我假设语法类似于:

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/**/`

...但这会产生错误:Error: ENOENT: no such file or directory, lstat 'app/**/*.scss'

...but that yields the error: Error: ENOENT: no such file or directory, lstat 'app/**/*.scss'

我正在尝试使用 node-sass 做的事情是否可行?如果没有,是否有更好的方法将我的 scss 文件批量编译为 css?如果可能,我正在尝试只使用 npm 脚本进行构建.

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.

推荐答案

尝试 node-sass -rw app -o app.您可能想要更改输出文件夹,因为这可能会不断循环.

Try node-sass -rw app -o app. You might want to change your output folder as this might keep looping.

来源:

-r, --recursive 递归观察目录或文件https://github.com/sass/node-sass

-r, --recursive Recursively watch directories or files https://github.com/sass/node-sass

这篇关于使用 node-sass 查看所有子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆