Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. function watchBegin(filePath){
  2. watcher = chokidar.watch(filePath,{
  3. persistent:true,
  4. ignoreInitial:true,//開始当初のフォルダーは反応させない
  5. depth:0//0にしないと再帰的にファイルをチェックするっぽい
  6. });
  7. watcher.on("add",f => {console.log(`file ${f} has been added`)
  8. dispatchJSX(f);
  9. })
  10. .on("change",f => console.log(`file ${f} has been changed`))
  11. .on("unlink",f => console.log(`file ${f} has been removed`));
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement