mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 16:05:12 +08:00
26 lines
782 B
TypeScript
26 lines
782 B
TypeScript
import { app, BrowserWindow } from 'electron'
|
|
// @ts-ignore
|
|
import path from "node:path";
|
|
import { fileURLToPath } from 'node:url'
|
|
import { dirname } from 'node:path'
|
|
|
|
app.whenReady().then(() => {
|
|
// @ts-ignore
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
const __dirname = dirname(__filename)
|
|
const win = new BrowserWindow({
|
|
title: 'OGame',
|
|
icon: path.join(__dirname, '../public/favicon.ico'),
|
|
width: 1200,
|
|
height: 800,
|
|
})
|
|
win.setMenu(null);
|
|
|
|
// You can use `process.env.VITE_DEV_SERVER_URL` when the vite command is called `serve`
|
|
if (process.env.VITE_DEV_SERVER_URL) {
|
|
win.loadURL(process.env.VITE_DEV_SERVER_URL)
|
|
} else {
|
|
// Load your file
|
|
win.loadFile('docs/index.html');
|
|
}
|
|
}) |