Last 12 weeks · 0 commits
4 of 6 standards met
while using this code getting following issue App threw an error during load Error [ERR_REQUIRE_ESM]: require() of ES Module D:\project\node_modules\electron-is-dev\index.js from D:\ecosail\index.js not supported here is my code of electron index.js const { app, BrowserWindow, Menu } = require('electron'); const path = require('path'); const isDev = require('electron-is-dev'); function createWindow() { const win = new BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: true, // Consider using contextIsolation and preload instead webSecurity: false // to disable web security (consider enabling for production) } }); if (isDev) { console.log('Running in development'); } else { console.log('Running in production'); } win.loadURL("http://localhost:3000/"); //win.webContents.openDevTools(); } app.on('ready', () => { const menu = Menu.buildFromTemplate([]); Menu.setApplicationMenu(menu); createWindow(); }); app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit(); } }); app.on('activate', () => { if (BrowserWindow.getAllWindows().length === 0) { createWindow(); } }); !Screenshot (17)
Repository: sindresorhus/electron-is-dev. Description: Check if Electron is running in development Stars: 443, Forks: 34. Primary language: JavaScript. Languages: JavaScript (81.4%), TypeScript (18.6%). License: MIT. Latest release: v3.0.1 (2y ago). Open PRs: 0, open issues: 0. Last activity: 9mo ago. Community health: 85%. Top contributors: sindresorhus, kevva, Richienb, BendingBender, zeke, popod.