import { app , BrowserWindow } from "electron" ; import * as path from "path" ; import * as url from "url" ; let currentWindow ; function newWindow ( ) { currentWindow = new BrowserWindow ( { title : "eeQL" , icon : null , backgroundColor : "##1c90f5" , height : 800 , width : 800 , webPreferences : { nodeIntegration : true } , } ) ; if ( process . env . NODE_ENV === "development" ) { currentWindow . loadURL ( "http://localhost:4000" ) ; currentWindow . webContents . openDevTools ( ) ; } else { currentWindow . loadURL ( url . format ( { pathname : path . resolve ( __dirname , "../dist/index.html" ) , protocol : "file:" , slashes : true , } ) ) ; } currentWindow . on ( "closed" , ( ) => { currentWindow = null ; } ) ; } app . on ( "ready" , newWindow ) ; app . allowRendererProcessReuse = true ;