"use strict";
|
const { app, BrowserWindow } = require("electron");
|
const { join } = require("path");
|
process.env["ELECTRON_DISABLE_SECURITY_WARNINGS"] = "true";
|
const createWindow = () => {
|
const win = new BrowserWindow({
|
width: 800,
|
height: 600
|
});
|
if (process.env.VITE_DEV_SERVER_URL) {
|
win.loadURL(process.env.VITE_DEV_SERVER_URL);
|
win.webContents.openDevTools();
|
} else {
|
win.loadFile(join(__dirname, "../dist/index.html"));
|
}
|
};
|
app.whenReady().then(() => {
|
createWindow();
|
app.on("activate", () => {
|
if (BrowserWindow.getAllWindows().length === 0)
|
createWindow();
|
});
|
});
|
app.on("window-all-closed", () => {
|
if (process.platform !== "darwin")
|
app.quit();
|
});
|