// Bundles src/main.ts into dist/app.js and copies the static files next to it. // The output is committed and embedded into the Go binary (see embed.go), so a // plain `go build` produces a node with its UI and nobody needs Node to run // one. The bundle is deliberately not minified: it is the code that decides // whether a listing is genuine, so it should stay readable. import { build } from "esbuild"; import { cp, mkdir, rm } from "node:fs/promises"; await rm("dist", { recursive: true, force: true }); await mkdir("dist", { recursive: true }); await build({ entryPoints: ["src/main.ts"], bundle: true, format: "esm", target: "es2022", outfile: "dist/app.js", legalComments: "inline", logLevel: "info", }); await cp("static", "dist", { recursive: true });