-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.js
39 lines (31 loc) · 953 Bytes
/
index.js
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
36
37
38
39
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
const { app, BrowserWindow } = require('electron');
const theme = require('./utils/theme');
app.on('ready', () => {
const win = new BrowserWindow({
backgroundColor: theme.colors.themeBaseColor,
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true,
},
});
win.setAutoHideMenuBar(true);
win.setMenuBarVisibility(false);
win.loadFile('index.html');
win.on('closed', () => {
app.quit();
});
if (process.env.NODE_ENV !== 'production') {
const {
default: installExtension,
REACT_DEVELOPER_TOOLS,
REDUX_DEVTOOLS,
} = require('electron-devtools-installer');
installExtension(REACT_DEVELOPER_TOOLS)
.then(name => console.log(`Added Extension: ${name}`))
.catch(error => console.error(error));
installExtension(REDUX_DEVTOOLS)
.then(name => console.log(`Added Extension: ${name}`))
.catch(error => console.error(error));
}
});