Skip to content

Commit 706c76c

Browse files
committed
fixed webpack#2600
1 parent 6b4ced4 commit 706c76c

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

lib/dependencies/SystemImportDependency.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SystemImportDependency.Template.prototype.apply = function(dep, source, outputOp
2323
var promise = DepBlockHelpers.getDepBlockPromise(depBlock, outputOptions, requestShortener, "System.import");
2424
var comment = "";
2525
if(outputOptions.pathinfo) comment = "/*! " + requestShortener.shorten(dep.request) + " */ ";
26-
if(promise) {
26+
if(promise && dep.module) {
2727
source.replace(depBlock.range[0], depBlock.range[1] - 1, promise + ".then(__webpack_require__.bind(null, " + comment + JSON.stringify(dep.module.id) + "))");
2828
} else if(dep.module) {
2929
source.replace(depBlock.range[0], depBlock.range[1] - 1, "Promise.resolve(__webpack_require__(" + comment + JSON.stringify(dep.module.id) + "))");

lib/dependencies/WebpackMissingModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exports.module = function(request) {
99
};
1010

1111
exports.promise = function(request) {
12-
return "Promise.reject((function webpackMissingModule() { " +
12+
return "Promise.reject(function webpackMissingModule() { " +
1313
"var e = new Error(" + JSON.stringify("Cannot find module \"" + request + "\"") + "); " +
1414
"e.code = 'MODULE_NOT_FOUND'; " +
1515
"return e; " +
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = [
2+
[/Can't resolve 'missing'/]
3+
];
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if(Math.sin(1) > 1000)
2+
System.import("missing");
3+
4+
it("should run", function() {});

0 commit comments

Comments
 (0)