electron npm script

This commit is contained in:
Kyle Spearrin 2018-01-17 15:42:28 -05:00
parent 6c6cceb3c0
commit a4abddfb6a
2 changed files with 5 additions and 4 deletions

View File

@ -8,7 +8,7 @@
"lint": "tslint src/**/*.ts || true",
"lint:fix": "tslint src/**/*.ts --fix",
"server": "webpack-dev-server --inline --progress --port 8080 --config webpack.dev.js",
"electron:dev": "npm run dev && tsc src/main.ts --outDir build && electron ./build --serve"
"electron": "npm run dev && tsc src/main.ts --outDir build && electron ./build --dev --watch"
},
"devDependencies": {
"@bitwarden/jslib": "git+https://github.com/bitwarden/jslib.git",

View File

@ -4,9 +4,10 @@ import * as url from 'url';
let win: BrowserWindow;
const args = process.argv.slice(1);
const serve = args.some((val) => val === '--serve');
const watch = args.some((val) => val === '--watch');
const dev = args.some((val) => val === '--dev');
if (serve) {
if (watch) {
require('electron-reload')(__dirname, {});
}
@ -29,7 +30,7 @@ function createWindow() {
}));
// Open the DevTools.
if (serve) {
if (dev) {
win.webContents.openDevTools();
}