首页 > 解决方案 > Sass:有没有办法递归地查看文件?

问题描述

我是 Sass 的新手,我正在更新使用 Node-Sass 和 Node-Sass-Chokidar 的 NodeJS 项目的依赖项。我已将其切换到 Sass 并在将旧脚本转换为 Sass 时成功编译,但我得到以下输出:

Error: ENOSPC: System limit for number of file watchers reached, watch 'some/path/some-file'
Error: ENOSPC: System limit for number of file watchers reached, watch 'some/path/some-file'
Error: ENOSPC: System limit for number of file watchers reached, watch 'some/path/some-file'
Error: ENOSPC: System limit for number of file watchers reached, watch 'some/path/some-file'
...

我的新build-csswatch-css看起来像这样:

"build-css": "sass --load-path=./src --load-path=./node_modules src:src",
"watch-css": "npm run build-css && sass --load-path=./src --load-path=./node_modules src:src --watch",

我的老build-csswatch-css曾经看起来像这样:

"build-css-old": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
"watch-css-old": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",

我在翻译它们时是否搞砸了,还是因为--recursive在 Sass 中没有选择(据我所知)?

Sass和的版本Node-Sass-Chokidar

...
"node-sass-chokidar": "^1.5.0",
"sass": "^1.43.4",
...

标签: node.jssassnode-sassnode-sass-chokidar

解决方案


推荐阅读