Skip to content

Commit

Permalink
Merge pull request #11603 from MayaWolf/master
Browse files Browse the repository at this point in the history
Fix require handling with electron; fixes #11599
  • Loading branch information
sokra committed Oct 10, 2020
2 parents 76e8cbd + 906a447 commit bfc35d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/config/defaults.js
Expand Up @@ -581,19 +581,19 @@ const applyOutputDefaults = (
});
F(output, "chunkFormat", () => {
if (tp) {
if (tp.document) return "array-push";
if (tp.require) return "commonjs";
if (tp.nodeBuiltins) return "commonjs";
if (tp.document) return "array-push";
if (tp.importScripts) return "array-push";
if (tp.dynamicImport && output.module) return "module";
}
return false;
});
F(output, "chunkLoading", () => {
if (tp) {
if (tp.document) return "jsonp";
if (tp.require) return "require";
if (tp.nodeBuiltins) return "async-node";
if (tp.document) return "jsonp";
if (tp.importScripts) return "import-scripts";
if (tp.dynamicImport && output.module) return "import";
if (
Expand Down
2 changes: 1 addition & 1 deletion lib/electron/ElectronTargetPlugin.js
Expand Up @@ -31,7 +31,7 @@ class ElectronTargetPlugin {
"original-fs",
"screen",
"shell"
]);
]).apply(compiler);
switch (this._context) {
case "main":
new ExternalsPlugin("commonjs", [
Expand Down

0 comments on commit bfc35d6

Please sign in to comment.