mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 20:07:06 +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) {
|
if (electronProcess) {
|
||||||
electronProcess.removeAllListeners()
|
electronProcess.removeAllListeners()
|
||||||
electronProcess.kill()
|
electronProcess.kill()
|
||||||
electronProcess = null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
electronProcess = spawn(electron, ['.'], { env })
|
electronProcess = spawn(electron, ['.'], { env })
|
||||||
electronProcess.on('exit', process.exit)
|
electronProcess.once('exit', process.exit)
|
||||||
// https://github.com/electron-vite/electron-vite-vue/pull/129
|
// https://github.com/electron-vite/electron-vite-vue/pull/129
|
||||||
electronProcess.stdout.on('data', (data) => {
|
electronProcess.stdout.on('data', (data) => {
|
||||||
const str = data.toString().trim()
|
const str = data.toString().trim()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user