// main.js import { app, BrowserWindow } from 'electron'; import path from 'path'; function createWindow() { const mainWindow = new BrowserWindow({ width: 800, height: 600, webPreferences: { contextIsolation: false, // Set to false to enable console interaction enableRemoteModule: true, // Set to true if you need to use the remote module nodeIntegration: true // Ensure this is set to true to load renderer.js } }); mainWindow.maximize(); mainWindow.loadFile('index.html'); mainWindow.webContents.openDevTools(); } app.on('ready', createWindow); app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit(); } }); app.on('activate', () => { if (BrowserWindow.getAllWindows().length === 0) { createWindow(); } });