Skip to content

Commit 6ac8713

Browse files
committed
moved error handler back to MainTemplate
1 parent cb3d8e2 commit 6ac8713

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

lib/JsonpMainTemplatePlugin.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ JsonpMainTemplatePlugin.prototype.apply = function(mainTemplate) {
2626
}
2727
return source;
2828
});
29-
mainTemplate.plugin("require-extensions", function(source, chunk) {
30-
if(chunk.chunks.length === 0) return source;
31-
return this.asString([
32-
source,
33-
"",
34-
"// on error function for async loading",
35-
this.requireFn + ".oe = function(err) { throw err; };"
36-
]);
37-
});
3829
mainTemplate.plugin("jsonp-script", function(_, chunk, hash) {
3930
var filename = this.outputOptions.filename;
4031
var chunkFilename = this.outputOptions.chunkFilename;

lib/MainTemplate.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ function MainTemplate(outputOptions) {
7474
"loaded: false"
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+
});
7786
this.plugin("require-extensions", function(source, chunk, hash) {
7887
var buf = [];
7988
if(chunk.chunks.length > 0) {

0 commit comments

Comments
 (0)