feat: loadFile

This commit is contained in:
草鞋没号 2021-11-01 19:30:39 +08:00
parent 0fb526481d
commit 636e6c38ea
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import { join } from 'path'
import { app, BrowserWindow } from 'electron'
const WINDOWS: Record<string, BrowserWindow | null> = {
@ -11,7 +12,7 @@ function mainWin() {
})
if (app.isPackaged) {
WINDOWS.main.loadFile('')
WINDOWS.main.loadFile(join(__dirname, '../react-ts/index.html'))
} else {
WINDOWS.main.loadURL(`http://127.0.0.1:${process.env.PORT}`)
}