This commit is contained in:
Your Name 2021-11-05 00:14:11 -04:00
parent 7b950bd7d9
commit 74739af031
2 changed files with 6 additions and 3 deletions

@ -1,11 +1,13 @@
const { app, BrowserWindow, Menu, globalShortcut, shell } = require("electron"); const { app, BrowserWindow, Menu, globalShortcut, shell } = require("electron");
const debug = false;
Menu.setApplicationMenu(false); Menu.setApplicationMenu(false);
function createWindow() { function createWindow() {
const win = new BrowserWindow({ const win = new BrowserWindow({
show: false, show: false,
webPreferences: { webPreferences: {
// devTools: true, devTools: debug,
}, },
}); });
@ -13,7 +15,8 @@ function createWindow() {
win.maximize(); win.maximize();
win.loadFile("index.html"); win.loadFile("index.html");
win.show(); win.show();
// win.webContents.openDevTools(); if(debug)
win.webContents.openDevTools();
globalShortcut.register("f5", function () { globalShortcut.register("f5", function () {
win.loadFile("index.html"); win.loadFile("index.html");
}); });

@ -109,6 +109,6 @@
"test:watch": "jest --watch", "test:watch": "jest --watch",
"watch": "webpack --watch --mode production", "watch": "webpack --watch --mode production",
"watch:dev": "webpack --watch --mode development", "watch:dev": "webpack --watch --mode development",
"electron": "cp -r electron/* .package && cp index.html .package && cp main.bundle.js .package && cp dist/vendor.bundle.js .package && electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png" "electron": "cp -r electron/* .package && cp index.html .package && cp main.bundle.js .package && cp dist/vendor.bundle.js .package/dist && electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png"
} }
} }