Skip to content

Commit

Permalink
fix(nmf): Fix exports for var injection to include free glob exports …
Browse files Browse the repository at this point in the history
…or arguments
  • Loading branch information
TheLarkInn committed Jan 15, 2017
1 parent 437dce4 commit 5a3a23f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/NormalModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,9 @@ NormalModule.prototype.source = function(dependencyTemplates, outputOptions, req

var emitFunction = function emitFunction() {
if(varNames.length === 0) return;

varStartCode += "/* WEBPACK VAR INJECTION */(function(" + varNames.join(", ") + ") {";
// exports === this in the topLevelBlock, but exports do compress better...
varEndCode = (topLevelBlock === block ? "}.call(exports, " : "}.call(this, ") +
varEndCode = (topLevelBlock === block ? "}.call(module.exportsArgument || 'exports', " : "}.call(this, ") +
varExpressions.map(function(e) {
return e.source();
}).join(", ") + "))" + varEndCode;
Expand Down

0 comments on commit 5a3a23f

Please sign in to comment.