修复开发模式启动问题

pull/1853/head
lyswhut 2024-04-08 19:25:48 +08:00
parent bfd2ecd26c
commit 1dbb950b3c
1 changed files with 6 additions and 2 deletions

View File

@ -133,6 +133,7 @@ function startRendererScripts() {
} }
function startMain() { function startMain() {
let firstRun = true
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main) // mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main)
// mainConfig.mode = 'development' // mainConfig.mode = 'development'
@ -153,17 +154,20 @@ function startMain() {
} }
// logStats('Main', stats) // logStats('Main', stats)
resolve()
if (electronProcess) { if (electronProcess) {
electronProcess.removeAllListeners() electronProcess.removeAllListeners()
treeKill(electronProcess.pid) treeKill(electronProcess.pid)
} }
runElectronDelay() if (firstRun) {
firstRun = false
resolve()
} else runElectronDelay()
}) })
}) })
} }
function startElectron() { function startElectron() {
console.log('startElectron')
let args = [ let args = [
'--inspect=5858', '--inspect=5858',
// 'NODE_ENV=development', // 'NODE_ENV=development',