(mode: BuildMode)
| 288 | // --------------------------------------------------------------------------- |
| 289 | |
| 290 | const buildWeb = async (mode: BuildMode) => { |
| 291 | const webDist = join(webRoot, "dist"); |
| 292 | await rm(webDist, { recursive: true, force: true }); |
| 293 | |
| 294 | console.log(`Building web app (${mode})...`); |
| 295 | const proc = Bun.spawn(["bun", "run", "build", "--mode", mode], { |
| 296 | cwd: webRoot, |
| 297 | stdio: ["ignore", "inherit", "inherit"], |
| 298 | env: { ...process.env, NODE_ENV: mode }, |
| 299 | }); |
| 300 | if ((await proc.exited) !== 0) throw new Error("Web build failed"); |
| 301 | return webDist; |
| 302 | }; |
| 303 | |
| 304 | // --------------------------------------------------------------------------- |
| 305 | // Embedded web UI — generates a virtual module that imports all web assets |
no test coverage detected