()
| 54 | * plugin serves without standing up Vite. |
| 55 | */ |
| 56 | export const bundleInnerRenderer = async (): Promise<string> => { |
| 57 | const { build } = await import("esbuild"); |
| 58 | const result = await build({ |
| 59 | entryPoints: [innerRendererEntry()], |
| 60 | absWorkingDir: packageRoot, |
| 61 | bundle: true, |
| 62 | write: false, |
| 63 | format: "iife", |
| 64 | platform: "browser", |
| 65 | target: "es2022", |
| 66 | jsx: "automatic", |
| 67 | define: { |
| 68 | "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV ?? "development"), |
| 69 | }, |
| 70 | }); |
| 71 | |
| 72 | const js = result.outputFiles[0]; |
| 73 | if (!js) { |
| 74 | // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: Vite plugin hooks report build failures by throwing |
| 75 | throw new Error("Failed to bundle the MCP-Apps inner renderer."); |
| 76 | } |
| 77 | return js.text; |
| 78 | }; |
| 79 | |
| 80 | export const smokeHarnessEntry = (): string => |
| 81 | path.resolve(packageRoot, "src/shell/smoke-harness.tsx"); |
no test coverage detected