fix(#298): use VITE_DEV_SERVER_URL instead app.isPackaged

This commit is contained in:
草鞋没号 2022-11-03 09:07:24 +08:00
parent e89fa00a58
commit b2ef751ada

View File

@ -52,12 +52,12 @@ async function createWindow() {
},
})
if (app.isPackaged) {
win.loadFile(indexHtml)
} else {
if (process.env.VITE_DEV_SERVER_URL) { // #298
win.loadURL(url)
// Open devTool if the app is not packaged
win.webContents.openDevTools()
} else {
win.loadFile(indexHtml)
}
// Test actively push message to the Electron-Renderer