From 0b45739efb823870649de8b99a9cdceffdc35664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Alnet?= Date: Sun, 14 Jul 2019 01:12:28 +0200 Subject: [PATCH 1/3] webpack plugin: properly references `index.js` When building an executable using `electron-force make`, setting `publicPath` as `/` leads (for example) to `index.js` being referenced as `file:///main_window/index.js`, which cannot be found. (The URL points to `/main_window/index.js`, which is incorect. It should be `../main_window/index.js`.) When it is unset, the build runs properly and provides the correct URL. (This still works with `electron-forge start` as well.) --- packages/plugin/webpack/src/WebpackPlugin.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/plugin/webpack/src/WebpackPlugin.ts b/packages/plugin/webpack/src/WebpackPlugin.ts index ce03bfc38f..a64a31162d 100644 --- a/packages/plugin/webpack/src/WebpackPlugin.ts +++ b/packages/plugin/webpack/src/WebpackPlugin.ts @@ -425,7 +425,6 @@ Your packaged app may be larger than expected if you dont ignore everything othe error: tab.log.bind(tab), warn: tab.log.bind(tab), }, - publicPath: '/', hot: true, historyApiFallback: true, writeToDisk: true, From 41a653f7d77f2c4d7511d6710ee3076d485a6365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Alnet?= Date: Sun, 14 Jul 2019 10:57:07 +0200 Subject: [PATCH 2/3] publicPath is needed for hot module reloading As noted in #713 --- packages/plugin/webpack/src/WebpackPlugin.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/plugin/webpack/src/WebpackPlugin.ts b/packages/plugin/webpack/src/WebpackPlugin.ts index a64a31162d..d9bc4644cb 100644 --- a/packages/plugin/webpack/src/WebpackPlugin.ts +++ b/packages/plugin/webpack/src/WebpackPlugin.ts @@ -425,6 +425,7 @@ Your packaged app may be larger than expected if you dont ignore everything othe error: tab.log.bind(tab), warn: tab.log.bind(tab), }, + ...(this.isProd ? {} : publicPath: '/'), hot: true, historyApiFallback: true, writeToDisk: true, From b19eeacb80ffa49452236926191e13481668270c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Alnet?= Date: Sun, 14 Jul 2019 11:03:43 +0200 Subject: [PATCH 3/3] correct syntax --- packages/plugin/webpack/src/WebpackPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin/webpack/src/WebpackPlugin.ts b/packages/plugin/webpack/src/WebpackPlugin.ts index d9bc4644cb..b419c9f712 100644 --- a/packages/plugin/webpack/src/WebpackPlugin.ts +++ b/packages/plugin/webpack/src/WebpackPlugin.ts @@ -425,7 +425,7 @@ Your packaged app may be larger than expected if you dont ignore everything othe error: tab.log.bind(tab), warn: tab.log.bind(tab), }, - ...(this.isProd ? {} : publicPath: '/'), + ...(this.isProd ? {} : { publicPath: '/' }), hot: true, historyApiFallback: true, writeToDisk: true,