import { build } from "esbuild"; import { join, dirname } from "node:path"; import { fileURLToPath } from "node:url"; const __dirname = dirname(fileURLToPath(import.meta.url)); // __dirname is dist/ after tsc, root is one level up const root = join(__dirname, ".."); await build({ entryPoints: [join(root, "src", "ui", "app.ts")], bundle: true, format: "esm", outfile: join(root, "dist", "ui", "app.js"), minify: true, sourcemap: true, target: "es2022", }); console.log("UI bundle built: dist/ui/app.js");