当涉及到乔基达尔配置时,我希望设置这些选项。除了xml文件之外,我想忽略所有东西。
{
"path": "C:/... my path ...",
"options": {
"ignored": "everything except xml files",
"persistent": true
}
}一个可能的解决办法是
但是,是否有一种方法可以将JSON配置文件的ignored属性设置为“忽略除.xml文件之外的所有内容”,而不是通过代码设置它?
我试着用这个代码
{
"path": "C:/...",
"options": {
"ignored": "!**.xml",
"persistent": true
}
}
const chokidar = require('chokidar');
const { path, options } = require('../fileSystemWatcherConfiguration.json');
module.exports = eventEmitter => {
const watcher = chokidar.watch(path, options);
}但是watcher.on('add', func)事件在每个文件扩展名上都会被触发。
https://stackoverflow.com/questions/54810732
复制相似问题