build: remove catch-all entry point build, use app.ts only

This commit is contained in:
2026-06-16 11:06:46 +02:00
committed by Milas Holsting
parent ac33f1c0dd
commit a83377671e

View File

@@ -1,5 +1,4 @@
import { copyFile } from "node:fs/promises"; import { copyFile } from "node:fs/promises";
import { readdirSync } from "node:fs";
import { spawnSync } from "node:child_process"; import { spawnSync } from "node:child_process";
type BuildStep = { type BuildStep = {
@@ -32,17 +31,12 @@ main().catch((error: unknown) => {
}); });
async function main(): Promise<void> { async function main(): Promise<void> {
const appEntries = readdirSync("./static", { withFileTypes: true })
.filter((entry) => entry.isFile() && entry.name.endsWith(".ts"))
.map((entry) => `./static/${entry.name}`)
.sort();
steps.push({ steps.push({
name: "app", name: "app",
command: [ command: [
"bun", "bun",
"build", "build",
...appEntries, "./static/app.ts",
"--outdir", "--outdir",
"./dist/static", "./dist/static",
"--target", "--target",
@@ -69,7 +63,7 @@ async function main(): Promise<void> {
await copyFile("./node_modules/htmx.org/dist/htmx.min.js", "./dist/static/htmx-lib.js"); await copyFile("./node_modules/htmx.org/dist/htmx.min.js", "./dist/static/htmx-lib.js");
const playerEntries = 1; const playerEntries = 1;
const totalEntries = playerEntries + appEntries.length; const totalEntries = playerEntries + 1;
const elapsedMs = Math.round(performance.now() - startedAt); const elapsedMs = Math.round(performance.now() - startedAt);
console.log(`ts build ok (${totalEntries} entries, ${elapsedMs}ms)`); console.log(`ts build ok (${totalEntries} entries, ${elapsedMs}ms)`);