Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function watchBegin(filePath){
- watcher = chokidar.watch(filePath,{
- persistent:true,
- ignoreInitial:true,//開始当初のフォルダーは反応させない
- depth:0//0にしないと再帰的にファイルをチェックするっぽい
- });
- watcher.on("add",f => {console.log(`file ${f} has been added`)
- dispatchJSX(f);
- })
- .on("change",f => console.log(`file ${f} has been changed`))
- .on("unlink",f => console.log(`file ${f} has been removed`));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement