-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
32 lines (32 loc) · 849 Bytes
/
main.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
"use strict";
exports.__esModule = true;
var electron_1 = require("electron");
var path = require("path");
var url = require("url");
var mainWindow;
var windowConfig;
var serve;
var args = process.argv.slice(1);
serve = args.some(function (val) { return val === '--serve'; });
windowConfig = {
width: 800,
height: 700
};
function createWindow() {
mainWindow = new electron_1.BrowserWindow(windowConfig);
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'dist/index.html'),
protocol: 'file:',
slashes: true
}));
mainWindow.webContents.openDevTools({
mode: 'undocked'
});
mainWindow.on('closed', function () {
mainWindow = null;
});
}
electron_1.app.on('ready', createWindow);
electron_1.app.on('window-all-closed', function () {
electron_1.app.quit();
});