diff --git a/dev.ts b/dev.ts index c962fd9..bff1a72 100644 --- a/dev.ts +++ b/dev.ts @@ -16,10 +16,9 @@ async function buildDocs() { args: ["task", "build"], cwd: "docs", }).output(); - console.log("Done!"); } -async function watchAndBuildDocs() { +async function watchAndBuildDocs(addr: Addr) { let changeOccurred = true; let running = false; setInterval(async () => { @@ -27,7 +26,9 @@ async function watchAndBuildDocs() { return; } running = true; + console.clear(); await buildDocs(); + alertListening(addr); changeOccurred = false; running = false; }, 250); @@ -51,9 +52,10 @@ function serveDist(addr: Addr) { } if (import.meta.main) { - watchAndBuildDocs(); - serveDist({ + const addr = { hostname: "0.0.0.0", port: 8180, - }); + }; + watchAndBuildDocs(addr); + serveDist(addr); }