Skip to content

Instantly share code, notes, and snippets.

@joeybaker
Created August 4, 2013 18:03
Show Gist options
  • Save joeybaker/6151231 to your computer and use it in GitHub Desktop.
Save joeybaker/6151231 to your computer and use it in GitHub Desktop.
(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