()
| 174 | await child.exited; |
| 175 | }; |
| 176 | const stopOnParentSignal = (): void => { |
| 177 | // A PTY/session teardown can signal the CLI while Vite is still optimizing |
| 178 | // dependencies, before the server's normal stop handle exists. Reap the |
| 179 | // owned child immediately; the CLI's signal waiter performs full cleanup |
| 180 | // once startup has completed. |
| 181 | void stop(); |
| 182 | }; |
| 183 | for (const signal of viteChildSignals) process.once(signal, stopOnParentSignal); |
| 184 | |
| 185 | const url = `http://127.0.0.1:${vitePort}`; |