Move exports identifier from UMD template to commonArgs

This commit is contained in:
Lars Kappert
2015-01-04 12:59:25 +01:00
parent a4c8895dc3
commit 17ce21509d
2 changed files with 2 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ UMDFormatter.prototype.transform = function (ast) {
defineArgs = defineArgs.concat(names);
defineArgs = [t.arrayExpression(defineArgs)];
var commonArgs = [];
var commonArgs = [t.identifier("exports")];
if (this.passModuleArg) commonArgs.push(t.identifier("module"));
commonArgs = commonArgs.concat(names.map(function (name) {
return t.callExpression(t.identifier("require"), [name]);

View File

@@ -2,6 +2,6 @@
if (typeof define === "function" && define.amd) {
define(AMD_ARGUMENTS, factory);
} else if (typeof exports !== "undefined") {
factory(exports, COMMON_ARGUMENTS);
factory(COMMON_ARGUMENTS);
}
});