Skip to content

Commit 5a3a23f

Browse files
committed
fix(nmf): Fix exports for var injection to include free glob exports or arguments
1 parent 437dce4 commit 5a3a23f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/NormalModule.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,9 @@ NormalModule.prototype.source = function(dependencyTemplates, outputOptions, req
270270

271271
var emitFunction = function emitFunction() {
272272
if(varNames.length === 0) return;
273-
274273
varStartCode += "/* WEBPACK VAR INJECTION */(function(" + varNames.join(", ") + ") {";
275274
// exports === this in the topLevelBlock, but exports do compress better...
276-
varEndCode = (topLevelBlock === block ? "}.call(exports, " : "}.call(this, ") +
275+
varEndCode = (topLevelBlock === block ? "}.call(module.exportsArgument || 'exports', " : "}.call(this, ") +
277276
varExpressions.map(function(e) {
278277
return e.source();
279278
}).join(", ") + "))" + varEndCode;

0 commit comments

Comments
 (0)