【发布时间】:2019-11-02 17:29:51
【问题描述】:
我有一个使用electron-reload的Electron项目,文件结构是:
./public/templates/ --------- contains some html that should be watched and trigger reload
./public/templates/test/ ---- contains some test/experimental html that should be ignored/not trigger reload
./notes --------------------- just containing some notes, this should not trigger reload
./node_modules -------------- should be ignored
./main.js ------------------- should trigger reload on change
我知道我可以通过在 main.js 中将选项 ignored 设置为要求电子重新加载来忽略目录。
这使用 chokidar 进行过滤,忽略的选项描述为 here
但我不知道如何忽略多个路径。
我试图要求像这样重新加载电子:
require('electron-reload')(__dirname, {ignored: /node_modules|notes|public\/templates\/test/gi});
但是当我在
public/templates/test/ 应用程序正在重新加载。
electron 5.0.6electron-reload 1.5.0
提前致谢 凯文
【问题讨论】:
标签: javascript node.js regex electron chokidar