import { app, BrowserWindow, Menu, ipcMain } from 'electron'; import { fileURLToPath } from 'node:url'; import path, { dirname } from 'node:path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); function createWindow() { Menu.setApplicationMenu(null); const win = new BrowserWindow({ width: 1200, height: 800, fullscreen: true, webPreferences: { preload: path.resolve(__dirname, './preload.js') }, }); win.loadURL(process.env.VITE_DEV_SERVER_URL || path.resolve(__dirname, '../dist/index.html')); if (process.env.NODE_ENV === 'development') win.webContents.openDevTools(); ipcMain.on('close-window', () => { win.close(); }); ipcMain.on('toggle-fullscreen', () => { win.setFullScreen(!win.isFullScreen()); }); ipcMain.on('toggle-devtools', () => { win.webContents.toggleDevTools(); }); } app.whenReady().then(createWindow);