mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 11:56:36 +08:00
chore: use .once
instead of .on
This commit is contained in:
parent
5e0cf0bd4a
commit
694f51fc9a
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user