🔧 Chokidar tweaks

This commit is contained in:
2022-04-14 17:02:20 -07:00
parent ddc9ecd089
commit 2376aeb0b9

View File

@@ -177,9 +177,7 @@ export default class ApiService extends Service {
});
};
fileWatcher
.once(
"add",
debounce((path, stats) => {
.once("add", (path, stats) => {
console.log("Watcher detected new files.");
console.log(
`File ${path} has been added with stats: ${JSON.stringify(
@@ -213,41 +211,30 @@ export default class ApiService extends Service {
result: path,
});
});
}, 500)
)
.once(
"change",
debounce(
(path, stats) =>
console.log(
`File ${path} has been changed. Stats: ${JSON.stringify(
stats,
null,
2
)}`
),
500
)
)
})
// .once(
// "change",
// (path, stats) =>
// console.log(
// `File ${path} has been changed. Stats: ${JSON.stringify(
// stats,
// null,
// 2
// )}`
// )
// )
.once(
"unlink",
debounce(
(path) =>
console.log(
`File ${path} has been removed`
),
500
)
console.log(`File ${path} has been removed`)
)
.once(
"addDir",
debounce(
(path) =>
console.log(
`Directory ${path} has been added`
),
500
)
console.log(`Directory ${path} has been added`)
);
});
},