Skip to content

Commit

Permalink
Merge pull request #8038 from sharang-d/patch-5
Browse files Browse the repository at this point in the history
Correctly set the 'browser' value for electron-renderer
  • Loading branch information
sokra committed Sep 17, 2018
2 parents 5ade574 + bb4c2d1 commit 2f78aae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/WebpackOptionsDefaulter.js
Expand Up @@ -327,7 +327,11 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
this.set("resolve.extensions", [".wasm", ".mjs", ".js", ".json"]);
this.set("resolve.mainFiles", ["index"]);
this.set("resolve.aliasFields", "make", options => {
if (options.target === "web" || options.target === "webworker") {
if (
options.target === "web" ||
options.target === "webworker" ||
options.target === "electron-renderer"
) {
return ["browser"];
} else {
return [];
Expand Down

0 comments on commit 2f78aae

Please sign in to comment.