| 353 | return `export const shellHtmlUrl = ${JSON.stringify(url)};\nexport default shellHtmlUrl;\n`; |
| 354 | }, |
| 355 | configureServer(server) { |
| 356 | // Dev has no emitted assets directory, so the document is served straight |
| 357 | // from memory at the same URL the virtual module advertises. |
| 358 | server.middlewares.use("/assets", (req, res, next) => { |
| 359 | const url = (req as { url?: string }).url ?? ""; |
| 360 | if (!url.startsWith("/executor-mcp-apps-shell-")) { |
| 361 | next(); |
| 362 | return; |
| 363 | } |
| 364 | void load().then(({ html }) => { |
| 365 | res.setHeader("content-type", "text/html; charset=utf-8"); |
| 366 | res.setHeader("cache-control", "no-store"); |
| 367 | res.end(html); |
| 368 | }); |
| 369 | }); |
| 370 | }, |
| 371 | async generateBundle(_options, _bundle, _isWrite) { |
| 372 | if (command !== "build") return; |
| 373 | |