fix dev server responsiveness

This commit is contained in:
Theis Pieter Hollebeek 2025-10-15 12:10:03 +02:00
parent fb2dffbba7
commit ac890c9abd
2 changed files with 6 additions and 3 deletions

7
dev.ts
View File

@ -31,8 +31,11 @@ async function watchAndBuildDocs() {
changeOccurred = false;
running = false;
}, 250);
const watcher = Deno.watchFs(["docs/src"]);
for await (const _ of watcher) {
const watcher = Deno.watchFs(["docs"]);
for await (const ev of watcher) {
if (ev.paths.every((x) => x.includes("/docs/-/"))) {
continue;
}
changeOccurred = true;
}
}

View File

@ -46,7 +46,7 @@ function injectIntoTemplate(
"</head>",
"<body>",
[
`<nav>${breadcrumbs.join(" / ")}</nav>`,
`<nav><a href="/">Back to playground</a> | ${breadcrumbs.join(" / ")}</nav>`,
rendered,
],
"</body>",