electron npm script
This commit is contained in:
parent
6c6cceb3c0
commit
a4abddfb6a
|
@ -8,7 +8,7 @@
|
||||||
"lint": "tslint src/**/*.ts || true",
|
"lint": "tslint src/**/*.ts || true",
|
||||||
"lint:fix": "tslint src/**/*.ts --fix",
|
"lint:fix": "tslint src/**/*.ts --fix",
|
||||||
"server": "webpack-dev-server --inline --progress --port 8080 --config webpack.dev.js",
|
"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": {
|
"devDependencies": {
|
||||||
"@bitwarden/jslib": "git+https://github.com/bitwarden/jslib.git",
|
"@bitwarden/jslib": "git+https://github.com/bitwarden/jslib.git",
|
||||||
|
|
|
@ -4,9 +4,10 @@ import * as url from 'url';
|
||||||
|
|
||||||
let win: BrowserWindow;
|
let win: BrowserWindow;
|
||||||
const args = process.argv.slice(1);
|
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, {});
|
require('electron-reload')(__dirname, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ function createWindow() {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Open the DevTools.
|
// Open the DevTools.
|
||||||
if (serve) {
|
if (dev) {
|
||||||
win.webContents.openDevTools();
|
win.webContents.openDevTools();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue