Created
August 4, 2013 18:03
-
-
Save joeybaker/6151231 to your computer and use it in GitHub Desktop.
Universal Module definition va https://github.com/tbranyen/growing-up-with-backbone
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(window, factory) { | |
if (typeof exports === "object") { | |
// Node. Does not work with strict CommonJS, but only CommonJS-like | |
// enviroments that support module.exports, like Node. | |
module.exports = factory(); | |
} else if (typeof define === "function" && define.amd) { | |
// Allow using this built library as an AMD module in another project. That | |
// other project will only see this AMD call, not the internal modules in | |
// the closure below. | |
define(factory); | |
} else { | |
// Browser globals case. Just assign the result to a property on the | |
// global. | |
window.WebApp = factory(); | |
} | |
}(this, function() { | |
// Your code goes here. | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment