diff --git a/scripts/watch.mjs b/scripts/watch.mjs index e9ad855..c73473b 100644 --- a/scripts/watch.mjs +++ b/scripts/watch.mjs @@ -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()