From 8867e36489856aeaead5eb70bacb3ab25e148128 Mon Sep 17 00:00:00 2001 From: Paula Date: Tue, 24 Feb 2026 20:44:42 -0300 Subject: [PATCH] Actually build on run instead of waiting for mutation --- build.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/build.ts b/build.ts index 9304d4d..16c5167 100644 --- a/build.ts +++ b/build.ts @@ -20,9 +20,18 @@ async function build_client() { }); } +async function build() { + const now = performance.now(); + clear_folder(); + build_assets(); + await build_client(); + console.log(`Built in ${(performance.now() - now).toFixed(2)}ms`); +} + let last_build = 0; if (import.meta.main) { + await build(); const watcher = Deno.watchFs(["assets", "client", "common"], { recursive: true }); for await (const event of watcher) { const now = performance.now(); @@ -32,9 +41,7 @@ if (import.meta.main) { if (["create", "modify", "rename", "remove"].includes(event.kind)) { last_build = now; console.log("Rebuilding..."); - clear_folder(); - build_assets(); - await build_client(); + await build(); } } }