Last active
August 29, 2015 13:57
-
-
Save zsitro/9627256 to your computer and use it in GitHub Desktop.
Universal Module Definition
This file contains hidden or 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
(function (root, factory) { | |
if (typeof exports === 'object') { | |
// CommonJS | |
module.exports = factory(require('b')); | |
} else if (typeof define === 'function' && define.amd) { | |
// AMD | |
define(['b'], function (b) { | |
return (root.returnExportsGlobal = factory(b)); | |
}); | |
} else { | |
// Global Variables | |
root.returnExportsGlobal = factory(root.b); | |
} | |
}(this, function (b) { | |
// Your actual module | |
return {}; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment