Skip to content

Commit bfc35d6

Browse files
authored
Merge pull request #11603 from MayaWolf/master
Fix require handling with electron; fixes #11599
2 parents 76e8cbd + 906a447 commit bfc35d6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/config/defaults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,19 +581,19 @@ const applyOutputDefaults = (
581581
});
582582
F(output, "chunkFormat", () => {
583583
if (tp) {
584+
if (tp.document) return "array-push";
584585
if (tp.require) return "commonjs";
585586
if (tp.nodeBuiltins) return "commonjs";
586-
if (tp.document) return "array-push";
587587
if (tp.importScripts) return "array-push";
588588
if (tp.dynamicImport && output.module) return "module";
589589
}
590590
return false;
591591
});
592592
F(output, "chunkLoading", () => {
593593
if (tp) {
594+
if (tp.document) return "jsonp";
594595
if (tp.require) return "require";
595596
if (tp.nodeBuiltins) return "async-node";
596-
if (tp.document) return "jsonp";
597597
if (tp.importScripts) return "import-scripts";
598598
if (tp.dynamicImport && output.module) return "import";
599599
if (

lib/electron/ElectronTargetPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ElectronTargetPlugin {
3131
"original-fs",
3232
"screen",
3333
"shell"
34-
]);
34+
]).apply(compiler);
3535
switch (this._context) {
3636
case "main":
3737
new ExternalsPlugin("commonjs", [

0 commit comments

Comments
 (0)