-
Notifications
You must be signed in to change notification settings - Fork 26
/
umd.hbs
24 lines (21 loc) · 895 Bytes
/
umd.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define({{#if amdModuleId}}'{{amdModuleId}}', {{/if}}[{{{amdDependencies}}}], function ({{dependencies}}) {
return (root.returnExportsGlobal = factory({{dependencies}}));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory({{{cjsDependencies}}});
} else {
root.simple = root.simple || {};
{{#if globalAlias}}root.simple['{{{globalAlias}}}'] = {{else}}{{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}{{/if}}factory({{{globalDependencies}}});
}
}(this, function ({{dependencies}}) {
{{{code}}}
{{#if objectToExport}}
{{indent}}return {{{objectToExport}}};
{{/if}}
}));