Skip to content

Commit 06f143d

Browse files
committed
Fix missing __webpack_require__.oe()
1 parent 68b80bd commit 06f143d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

lib/MainTemplate.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ function MainTemplate(outputOptions) {
7474
"exports: {}"
7575
]);
7676
});
77-
this.plugin("require-extensions", function(source, chunk) {
78-
if(chunk.chunks.length === 0) return source;
79-
return this.asString([
80-
source,
81-
"",
82-
"// on error function for async loading",
83-
this.requireFn + ".oe = function(err) { console.error(err); throw err; };"
84-
]);
85-
});
8677
this.plugin("require-extensions", function(source, chunk, hash) {
8778
var buf = [];
8879
if(chunk.chunks.length > 0) {
@@ -108,6 +99,15 @@ function MainTemplate(outputOptions) {
10899
buf.push(this.requireFn + ".p = " + JSON.stringify(publicPath) + ";");
109100
return this.asString(buf);
110101
});
102+
this.plugin("require-extensions", function(source, chunk) {
103+
if(chunk.chunks.length === 0) return source;
104+
return this.asString([
105+
source,
106+
"",
107+
"// on error function for async loading",
108+
this.requireFn + ".oe = function(err) { console.error(err); throw err; };"
109+
]);
110+
});
111111
}
112112
module.exports = MainTemplate;
113113

0 commit comments

Comments
 (0)