use module id if available for umd global name - fixes #1166

This commit is contained in:
Sebastian McKenzie
2015-04-06 06:14:09 -07:00
parent c2776e63ae
commit 6b76f26ed8
4 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1 @@
foobar();

View File

@@ -0,0 +1,17 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define("MyLib", ["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
} else {
var mod = {
exports: {}
};
factory(mod.exports);
global.MyLib = mod.exports;
}
})(this, function (exports) {
"use strict";
foobar();
});

View File

@@ -0,0 +1,3 @@
{
"moduleId": "MyLib"
}