1.【electron-vue】进程无法杀死导致任务管理器资源飙升,电脑卡死的情况(改良版)
dev-runner.js 修改代码
if (electronProcess && electronProcess.kill) {
manualRestart = true
const pid = electronProcess.pid
var exec = require('child_process').exec;
exec(`TASKKILL /F /IM electron.exe`, function (err, data) {
if (err) console.log(err)
else console.log('kill pid: ' + pid + ' success!')
electronProcess = null
startElectron()
setTimeout(() => {
manualRestart = false
}, 5000)
})
}