1// The seam's build: one entry point, one file out.2//3// esbuild, no plugins, no framework, no CSS. The stylesheet system is the4// application's asset and is served from /assets by the application itself5// (docs/app.md ยง2.2); the seam contributes exactly one script, to /static,6// which is the tree the host mounted and which answers 404 when it mounted7// none. That separation is the deletability principle in the file layout:8// delete this lane and the page loses a script tag, not its stylesheet.910import { build, context } from "esbuild";11import { dirname, resolve } from "node:path";12import { fileURLToPath } from "node:url";1314const root = dirname(fileURLToPath(import.meta.url));15const watch = process.argv.includes("--watch");16const outfile = resolve(root, process.env.ATLAS_SEAM_OUT ?? "dist/app.js");1718/** @type {import("esbuild").BuildOptions} */19const options = {20 absWorkingDir: root,21 entryPoints: ["boot.ts"],22 bundle: true,23 format: "esm",24 target: ["safari16", "chrome110", "firefox110"],25 legalComments: "none",26 minify: !watch,27 sourcemap: watch,28 outfile,29 logLevel: "info",30};3132if (watch) {33 const built = await context(options);34 await built.watch();35} else {36 await build(options);37}