From 242de59540a724f9f6669e136fbfbecfebf23a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Farkas?= Date: Sun, 12 Mar 2017 20:10:41 +0100 Subject: [PATCH] Use webpack watch mode when developing with electron Closes #273 --- electron/src/electron-main.ts | 3 +-- package.json | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/electron/src/electron-main.ts b/electron/src/electron-main.ts index 4dd8c802..c2a2c566 100644 --- a/electron/src/electron-main.ts +++ b/electron/src/electron-main.ts @@ -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(); diff --git a/package.json b/package.json index f927beed..894ec079 100644 --- a/package.json +++ b/package.json @@ -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" } -} \ No newline at end of file +}