Skip to content

Commit

Permalink
chore: use .once instead of .on
Browse files Browse the repository at this point in the history
  • Loading branch information
caoxiemeihao committed May 28, 2022
1 parent 5e0cf0b commit 694f51f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/watch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ function watchMain(server) {
if (electronProcess) {
electronProcess.removeAllListeners()
electronProcess.kill()
electronProcess = null
}

electronProcess = spawn(electron, ['.'], { env })
electronProcess.on('exit', process.exit)
electronProcess.once('exit', process.exit)
// https://github.com/electron-vite/electron-vite-vue/pull/129
electronProcess.stdout.on('data', (data) => {
const str = data.toString().trim()
Expand Down

0 comments on commit 694f51f

Please sign in to comment.