Last active
August 12, 2016 09:12
-
-
Save Joopmicroop/0086b7b2c550cf10feb8ae49f01f519e to your computer and use it in GitHub Desktop.
write modules compatible for amd require/exports or root/window
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
(function (root, factory) { | |
if (typeof define === "function" && define.amd) define(factory); // amd | |
else if(typeof module == 'object') module.exports = factory(); // node require | |
else if(typeof exports == 'object') exports = factory(); // browserify | |
else root.ResizeSensor = factory(); // root/window | |
})(this, function () { | |
// code here | |
// return foo; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment