Use webpack watch mode when developing with electron

Closes #273
This commit is contained in:
József Farkas
2017-03-12 20:10:41 +01:00
parent adb7abaa12
commit 242de59540
2 changed files with 4 additions and 6 deletions

View File

@@ -21,9 +21,8 @@ function createWindow() {
const indexPath = path.resolve(__dirname, './index.html');
// and load the index.html of the app.
const url = process.argv[2] && process.argv[2].startsWith('--url=') ? process.argv[2].substring(6) : `file://${indexPath}`;
win.loadURL(url);
win.loadURL(`file://${indexPath}`);
win.on('page-title-updated', (event) => {
event.preventDefault();

View File

@@ -81,9 +81,8 @@
"build:usb": "electron-rebuild -w usb -p",
"build:test": "webpack --config \"test-serializer/webpack.config.js\"",
"server:web": "webpack-dev-server --config \"web/src/webpack.config.js\" --content-base \"./web/dist\"",
"server:electron": "webpack-dev-server --config \"electron/src/webpack.config.js\" --content-base \"./electron/dist\" --port 8081",
"electron:dev": "electron electron/dist/electron-main.js --url=http://localhost:8081",
"electron:prod": "electron electron/dist/electron-main.js",
"server:electron": "webpack --config \"electron/src/webpack.config.js\" --watch",
"electron": "electron electron/dist/electron-main.js",
"symlink": "node ./tools/symlinker"
}
}
}