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