()
| 113 | } |
| 114 | |
| 115 | async function allocatePort(): Promise<number> { |
| 116 | const probe = Bun.serve({ |
| 117 | port: 0, |
| 118 | hostname: "127.0.0.1", |
| 119 | fetch: () => new Response(), |
| 120 | }); |
| 121 | const port = probe.port ?? 0; |
| 122 | probe.stop(true); |
| 123 | return port; |
| 124 | } |
| 125 | |
| 126 | async function startViteChild(): Promise<ViteChild> { |
| 127 | const vitePort = await allocatePort(); |