Created
August 29, 2012 23:59
-
-
Save repeatingbeats/3520663 to your computer and use it in GitHub Desktop.
Terse version of UMD rootExports.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Terse implementations of the returnExports UMD wrapper (https://github.com/umdjs/umd/blob/master/returnExports.js) | |
// No dependencies | |
(function (root, factory) { | |
if (typeof exports === 'object') module.exports = factory(); | |
else if (typeof define === 'function' && define.amd) define(factory); | |
else root.moduleName = factory(); | |
}(this, function () { | |
// Return a module definition | |
return {}; | |
})); | |
// One dependency | |
(function (root, factory) { | |
if (typeof exports === 'object') module.exports = factory(require('dep')); | |
else if (typeof define === 'function' && define.amd) define([ 'dep' ], factory); | |
else root.moduleName = factory(root.dep); | |
}(this, function (dep) { | |
// Return a module definition | |
return {}; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment