fix
This commit is contained in:
parent
15147d9160
commit
c12a14bd8a
|
|
@ -109,22 +109,26 @@ export const initFrontEnd = async (
|
||||||
timeout: null,
|
timeout: null,
|
||||||
rebuilding: false,
|
rebuilding: false,
|
||||||
watch: watch(dir.data(root), async (event, filename) => {
|
watch: watch(dir.data(root), async (event, filename) => {
|
||||||
const ctx = code.internal.frontend[id_site];
|
const fe = code.internal.frontend[id_site];
|
||||||
if (
|
if (
|
||||||
ctx &&
|
fe &&
|
||||||
(filename?.endsWith(".tsx") ||
|
(filename?.endsWith(".tsx") ||
|
||||||
filename?.endsWith(".ts") ||
|
filename?.endsWith(".ts") ||
|
||||||
filename?.endsWith(".css") ||
|
filename?.endsWith(".css") ||
|
||||||
filename?.endsWith(".html"))
|
filename?.endsWith(".html"))
|
||||||
) {
|
) {
|
||||||
if (!ctx.rebuilding) {
|
if (!fe.rebuilding) {
|
||||||
ctx.rebuilding = true;
|
fe.rebuilding = true;
|
||||||
await ctx.ctx.rebuild();
|
await fe.ctx.rebuild();
|
||||||
ctx.rebuilding = false;
|
fe.rebuilding = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
const fe = code.internal.frontend[id_site];
|
||||||
|
fe.rebuilding = true;
|
||||||
|
await fe.ctx.rebuild();
|
||||||
|
fe.rebuilding = false;
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error("Error building front end", id_site);
|
console.error("Error building front end", id_site);
|
||||||
delete code.internal.frontend[id_site];
|
delete code.internal.frontend[id_site];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue