mirror of
https://github.com/alex8088/electron-vite.git
synced 2026-06-09 15:58:16 +08:00
Merge 96a25bb3467b92c1c4d9e929dad41d11575cb203 into 5a8bbe3d0e2b860307e2eff684fa9329cd9666f2
This commit is contained in:
commit
f79649a030
@ -157,5 +157,13 @@ export function startElectron(root: string | undefined): ChildProcess {
|
||||
const ps = spawn(electronPath, [entry].concat(args), { stdio: 'inherit' })
|
||||
ps.on('close', process.exit)
|
||||
|
||||
for (const signal of ['SIGINT', 'SIGTERM', 'SIGUSR2'] as NodeJS.Signals[]) {
|
||||
process.on(signal, () => {
|
||||
if (!ps.killed) {
|
||||
ps.kill(signal)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return ps
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user