| 111 | |
| 112 | // what the dev server's workers hold open, which a build's don't outlive |
| 113 | const killTree = (child: ChildProcess) => { |
| 114 | if (child.pid === undefined || child.exitCode !== null) return |
| 115 | if (process.platform === "win32") { |
| 116 | spawnSync("taskkill", ["/pid", String(child.pid), "/T", "/F"]) |
| 117 | return |
| 118 | } |
| 119 | try { |
| 120 | // the group it leads, as Turbopack's loader runs in processes of its own |
| 121 | process.kill(-child.pid, "SIGKILL") |
| 122 | } catch { |
| 123 | child.kill("SIGKILL") |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | interface Served { |
| 128 | status: number |