Files
gnss-tool-kit/src/main/app.ts

33 lines
649 B
TypeScript
Raw Normal View History

2021-03-09 14:59:24 +08:00
import { app, BrowserWindow } from 'electron'
function createWindow() {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
if (process.env.NODE_ENV === 'development') {
win.loadURL('http://localhost:3000/')
} else {
win.loadFile('dist/render/index.html')
}
}
app.whenReady().then(createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})