-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.js
More file actions
35 lines (27 loc) · 762 Bytes
/
main.js
File metadata and controls
35 lines (27 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const { app, BrowserWindow } = require('electron');
const path = require('path');
const active = 'stk-vis';
const isDev
= process.env.APP_DEV ?
(process.env.APP_DEV.trim() == "true") : false;
if (isDev) {
const { mainReloader, rendererReloader }
= require('electron-hot-reload');
mainReloader(path.join(app.getAppPath(), 'main.js'));
rendererReloader(
path.join(app.getAppPath(), 'dist', `${active}.js`)
);
}
function createWindow () {
// Create the browser window.
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
});
// and load the index.html of the app.
win.loadFile(`./dist/${active}.html`);
}
app.on('ready', createWindow);