const {app, BrowserWindow} = require('electron') const path = require('path') function createWindow() { // create the browser window const mainWindow = new BrowserWindow({ width: 1000, height: 1000, webPreferences: { nodeIntegration: true, contextIsolation:false, preload: path.join(__dirname, 'preload.js') } }) mainWindow.loadFile('index.html') mainWindow.webContents.openDevTools() } app.on('ready', () => { createWindow(); }); // app.whenReady().then(() => { // createWindow() // });