Skip to content

Instantly share code, notes, and snippets.

@LeeeeeeM
Created April 16, 2018 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeeeeeeM/14d2b76566b542208bf3c9589444a8df to your computer and use it in GitHub Desktop.
Save LeeeeeeM/14d2b76566b542208bf3c9589444a8df to your computer and use it in GitHub Desktop.
UMD
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
}
}(this, function () {
// Just return a value to define the module export.
// This example returns an object, but the module
// can return a function as the exported value.
return {};
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment