umd.hbs 770 B

12345678910111213141516171819202122
  1. (function (root, factory) {
  2. if (typeof define === 'function' && define.amd) {
  3. // AMD. Register as an anonymous module unless amdModuleId is set
  4. define('{{amdModuleId}}', [{{{amdDependencies.wrapped}}}], function ({{{dependencies}}}) {
  5. return (root['{{objectToExport}}'] = factory({{dependencies}}));
  6. });
  7. } else if (typeof exports === 'object') {
  8. // Node. Does not work with strict CommonJS, but
  9. // only CommonJS-like environments that support module.exports,
  10. // like Node.
  11. module.exports = factory({{{cjsDependencies.wrapped}}});
  12. } else {
  13. root['{{globalAlias}}'] = factory({{{globalDependencies.wrapped}}});
  14. }
  15. }(this, function ({{dependencies}}) {
  16. {{{code}}}
  17. {{#if objectToExport}}
  18. return {{objectToExport}};
  19. {{/if}}
  20. }));