import * as path from 'path' ; import { app , BrowserWindow } from 'electron' ; import { enableLiveReload } from 'electron-compile' ; import { DEVMODE } from '../utils/environment' ; if ( DEVMODE ) { enableLiveReload ( ) ; } let win = null ; app . on ( 'ready' , async ( ) => { win = new BrowserWindow ( { show : true , webPreferences : { nodeIntegration : true , experimentalFeatures : true } } ) ; win . loadURL ( 'file://' + path . join ( __dirname , '..' , 'pages' , 'index.html' ) ) ; win . on ( 'close' , ( ) => win = null ) ; if ( process . env . DEBUG ) { win . webContents . toggleDevTools ( ) ; } } ) ;