Skip to content

Commit b75ce7a

Browse files
committed
Revert "save 8 chars"
This reverts commit a83e15f. fixes webpack#176
1 parent 271fa8f commit b75ce7a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/MainTemplate.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ MainTemplate.prototype = Object.create(Template.prototype);
1616
MainTemplate.prototype.requireFn = "require";
1717
MainTemplate.prototype.render = function(hash, chunk, moduleTemplate, dependencyTemplates) {
1818
var buf = [];
19-
buf.push("// shortcut for better minimizing");
20-
buf.push("var exports = \"exports\";");
2119
buf.push(this.asString(this.renderAdditions(hash, chunk, moduleTemplate, dependencyTemplates)));
2220
buf.push(this.asString(this.renderLocalVars(hash, chunk)));
2321
buf.push("");
@@ -82,21 +80,21 @@ MainTemplate.prototype.renderRequireContent = function(hash, chunk) {
8280
return [
8381
"// Check if module is in cache",
8482
"if(installedModules[moduleId])",
85-
this.indent("return installedModules[moduleId][exports];"),
83+
this.indent("return installedModules[moduleId].exports;"),
8684
"",
8785
"// Create a new module (and put it into the cache)",
8886
"var module = installedModules[moduleId] = {",
8987
this.indent(this.renderModule(hash, chunk, "moduleId")),
9088
"};",
9189
"",
9290
"// Execute the module function",
93-
"modules[moduleId].call(module[exports], module, module[exports], " + this.renderRequireFunctionForModule(hash, chunk, "moduleId") + ");",
91+
"modules[moduleId].call(module.exports, module, module.exports, " + this.renderRequireFunctionForModule(hash, chunk, "moduleId") + ");",
9492
"",
9593
"// Flag the module as loaded",
9694
"module.loaded = true;",
9795
"",
9896
"// Return the exports of the module",
99-
"return module[exports];"
97+
"return module.exports;"
10098
];
10199
};
102100

0 commit comments

Comments
 (0)