Created
November 25, 2015 06:40
-
-
Save DarkaOnLine/0c6742fd12704d703136 to your computer and use it in GitHub Desktop.
Common js module boiler plate
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