Skip to content

Instantly share code, notes, and snippets.

@dbwhddn10
Created May 5, 2015 05:14
Show Gist options
  • Save dbwhddn10/67697b06b7b953be23e6 to your computer and use it in GitHub Desktop.
Save dbwhddn10/67697b06b7b953be23e6 to your computer and use it in GitHub Desktop.
umd
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['underscore'], factory);
} else if (typeof exports === 'object') {
// Node, CommonJS-like
module.exports = factory(require('underscore'));
} else {
// Browser globals (root is window)
root._ = factory(root._);
}
}(this, function (_) {
...
return {};
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment