feature: main,preload build
This commit is contained in:
1 parent
93fa203620
commit
7b92b312d6
8 files changed
+108
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { app, BrowserWindow } from 'electron'
|
||||
|
||||
const WINDOWS: Record<string, BrowserWindow | null> = {
|
||||
main: null,
|
||||
win1: null,
|
||||
}
|
||||
|
||||
function mainWin() {
|
||||
WINDOWS.main = new BrowserWindow({
|
||||
title: 'Main window',
|
||||
})
|
||||
|
||||
if (app.isPackaged) {
|
||||
WINDOWS.main.loadFile('')
|
||||
} else {
|
||||
WINDOWS.main.loadURL(`http://127.0.0.1:${process.env.PORT}`)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
app.whenReady().then(mainWin)
|
||||
app.on('window-all-closed', () => {
|
||||
Object.keys(WINDOWS).forEach((key) => WINDOWS[key] = null)
|
||||
})
|
||||
Whitespace-only changes.
Reference in new issue
Block a user