Skip to content

Instantly share code, notes, and snippets.

@ianaya89
Last active August 29, 2015 14:10
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 ianaya89/1c1f98f5f8a1ebe285b3 to your computer and use it in GitHub Desktop.
Save ianaya89/1c1f98f5f8a1ebe285b3 to your computer and use it in GitHub Desktop.
Universal Module Definition (UMD)
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['b'], factory); //AMD
} else if (typeof exports === 'object') {
module.exports = factory; //CommonJS
} else {
root.amdWeb = factory(root.b); //Global
}
}(this, function (b) {
return {}; //Module
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment