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