Created
January 15, 2014 17:33
-
-
Save Cycymomo/8440612 to your computer and use it in GitHub Desktop.
wrapperUMD (compat CommonJS, AMD et others)
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) { | |
// Ici votre module (fonction, objet, whatever...) | |
return {}; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment