(mode: BuildMode)
| 362 | // --------------------------------------------------------------------------- |
| 363 | |
| 364 | const buildWeb = async (mode: BuildMode) => { |
| 365 | const webDist = join(webRoot, "dist"); |
| 366 | await rm(webDist, { recursive: true, force: true }); |
| 367 | |
| 368 | console.log(`Building web app (${mode})...`); |
| 369 | const proc = Bun.spawn(["bun", "run", "build", "--mode", mode], { |
| 370 | cwd: webRoot, |
| 371 | stdio: ["ignore", "inherit", "inherit"], |
| 372 | env: { ...process.env, NODE_ENV: mode }, |
| 373 | }); |
| 374 | if ((await proc.exited) !== 0) throw new Error("Web build failed"); |
| 375 | return webDist; |
| 376 | }; |
| 377 | |
| 378 | // --------------------------------------------------------------------------- |
| 379 | // Embedded web UI — generates a virtual module that imports all web assets |
no test coverage detected