Skip to content

Commit

Permalink
feat: exit after Electron.app exited
Browse files Browse the repository at this point in the history
  • Loading branch information
caoxiemeihao committed May 23, 2022
1 parent 9a357d8 commit 0558371
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/watch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ function watchMain(server) {
const startElectron = {
name: 'electron-main-watcher',
writeBundle() {
electronProcess && electronProcess.kill()
if (electronProcess) {
electronProcess.removeAllListeners()
electronProcess.kill()
}
electronProcess = spawn(electron, ['.'], { stdio: 'inherit', env })
electronProcess.once('exit', process.exit)
},
}

Expand Down

0 comments on commit 0558371

Please sign in to comment.