Files
nixpkgs/pkgs/by-name/mo/models-dev/post-build-rename-index-file.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

19 lines
712 B
Diff

diff --git i/packages/web/script/build.ts w/packages/web/script/build.ts
index 9bdcdb3..e9ce1c9 100755
--- i/packages/web/script/build.ts
+++ w/packages/web/script/build.ts
@@ -14,6 +14,13 @@ for await (const file of new Bun.Glob("./public/*").scan()) {
await Bun.write(file.replace("./public/", "./dist/"), Bun.file(file));
}
+const distFiles = await fs.readdir("./dist");
+const htmlFile = distFiles.find(file => file.startsWith("index-") && file.endsWith(".html"));
+
+if (htmlFile) {
+ await fs.rename(`./dist/${htmlFile}`, "./dist/index.html");
+}
+
let html = await Bun.file("./dist/index.html").text();
html = html.replace("<!--static-->", Rendered);
await Bun.write("./dist/index.html", html);