feat: support loading

This commit is contained in:
草鞋没号 committed 2021-11-02 10:19:50 +08:00
1 parent ad9e8a4937
commit 62531ae987
5 files changed
+104 -2

No files matched your search

+4
View File
@@ -9,12 +9,16 @@ const WINDOWS: Record<string, BrowserWindow | null> = {
function mainWin() {
WINDOWS.main = new BrowserWindow({
title: 'Main window',
webPreferences: {
preload: join(__dirname, '../preload/index.main')
},
})
if (app.isPackaged) {
WINDOWS.main.loadFile(join(__dirname, '../react-ts/index.html'))
} else {
WINDOWS.main.loadURL(`http://127.0.0.1:${process.env.PORT}`)
WINDOWS.main.maximize()
}
}