(mode: BuildMode)
| 314 | // --------------------------------------------------------------------------- |
| 315 | |
| 316 | const buildWeb = async (mode: BuildMode) => { |
| 317 | const webDist = join(webRoot, "dist"); |
| 318 | await rm(webDist, { recursive: true, force: true }); |
| 319 | |
| 320 | console.log(`Building web app (${mode})...`); |
| 321 | const proc = Bun.spawn(["bun", "run", "build", "--mode", mode], { |
| 322 | cwd: webRoot, |
| 323 | stdio: ["ignore", "inherit", "inherit"], |
| 324 | env: { ...process.env, NODE_ENV: mode }, |
| 325 | }); |
| 326 | if ((await proc.exited) !== 0) throw new Error("Web build failed"); |
| 327 | return webDist; |
| 328 | }; |
| 329 | |
| 330 | // --------------------------------------------------------------------------- |
| 331 | // Embedded web UI — generates a virtual module that imports all web assets |
no test coverage detected