Skip to content
Browse files

fix(plugin-webpack): properly reference `index.js` in production (#1021)

* 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 d70ae5c27cca22cdb5a269f7ee955ff562aa99f5
Showing with 1 addition and 1 deletion.
  1. +1 −1 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),
publicPath: '/',
...(this.isProd ? {} : { publicPath: '/' }),
hot: true,
historyApiFallback: true,
writeToDisk: true,

0 comments on commit d70ae5c

Please sign in to comment.
You can’t perform that action at this time.