This commit is contained in:
Rizky 2024-08-16 10:54:15 +07:00
parent 30ccaac624
commit cac2e1ea1e
1 changed files with 48 additions and 46 deletions

View File

@ -75,12 +75,15 @@ export const initFrontEnd = async (
rebuilding: false, rebuilding: false,
}; };
if (!code.internal.frontend[id_site].watch) { if (code.internal.frontend[id_site].watch) {
console.log('watching', dir.data(root)) code.internal.frontend[id_site].watch.close();
}
console.log("watching", dir.data(root));
code.internal.frontend[id_site].watch = watch( code.internal.frontend[id_site].watch = watch(
dir.data(root), dir.data(root),
{ {
recursive: true, recursive: true,
persistent: true
}, },
async (event, filename) => { async (event, filename) => {
const fe = code.internal.frontend[id_site]; const fe = code.internal.frontend[id_site];
@ -124,7 +127,6 @@ export const initFrontEnd = async (
} }
} }
); );
}
const fe = code.internal.frontend[id_site]; const fe = code.internal.frontend[id_site];
fe.rebuilding = true; fe.rebuilding = true;
try { try {