Keyborg/server/autoBundler.ts
2025-01-21 23:19:14 +03:00

19 lines
421 B
TypeScript

import bundle from "./bundler.ts";
const directoryToWatch = "./src/client_js"; // Update this to your directory
const watcher = Deno.watchFs(directoryToWatch);
for await (const event of watcher) {
if (
event.kind === "modify" || event.kind === "create" ||
event.kind === "remove"
) {
try {
await bundle();
} catch (e) {
console.log(e);
}
}
}