Skip to content

Commit

Permalink
fix(plugin-webpack): properly reference index.js in production (#1021)
Browse files Browse the repository at this point in the history
* 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.)

* publicPath is needed for hot module reloading

As noted in #713

* correct syntax
  • Loading branch information
shimaore authored and malept committed Jul 15, 2019
1 parent 1d19b32 commit d70ae5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin/webpack/src/WebpackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
publicPath: '/',
...(this.isProd ? {} : { publicPath: '/' }),
hot: true,
historyApiFallback: true,
writeToDisk: true,
Expand Down

0 comments on commit d70ae5c

Please sign in to comment.