mirror of
https://github.com/LinoSchmidt/StickExporterTX.git
synced 2026-03-21 10:00:47 +01:00
added webpack dev server, slightly improved ui and render preview
This commit is contained in:
14
src/index.ts
14
src/index.ts
@@ -1,5 +1,6 @@
|
||||
import {app, BrowserWindow} from 'electron';
|
||||
import {initialize as remoteInitialize, enable as remoteEnable} from '@electron/remote/main';
|
||||
import path from 'path';
|
||||
|
||||
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
|
||||
if (require('electron-squirrel-startup')) {
|
||||
@@ -14,20 +15,21 @@ const createWindow = () => {
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false
|
||||
contextIsolation: false,
|
||||
}
|
||||
});
|
||||
|
||||
if(app.isPackaged) mainWindow.setMenu(null);
|
||||
// remove the menu bar when in production.
|
||||
if(process.env.NODE_ENV === 'production') mainWindow.setMenu(null);
|
||||
|
||||
remoteInitialize();
|
||||
remoteEnable(mainWindow.webContents);
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile("src/index.html");
|
||||
// load the index.html of the app.
|
||||
mainWindow.loadFile(path.join(__dirname, 'index.html'));
|
||||
|
||||
// Open the DevTools.
|
||||
if(!app.isPackaged) mainWindow.webContents.openDevTools();
|
||||
// Open the DevTools when in development mode.
|
||||
if(process.env.NODE_ENV === 'development') mainWindow.webContents.openDevTools();
|
||||
};
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
|
||||
Reference in New Issue
Block a user