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