Created
August 25, 2014 16:52
-
-
Save micahwave/3d78acc713ba31301a28 to your computer and use it in GitHub Desktop.
Backbone define
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) { | |
// Set up Backbone appropriately for the environment. | |
if (typeof exports !== 'undefined') { | |
// Node/CommonJS, no need for jQuery in that case. | |
factory(root, exports, require('underscore')); | |
} else if (typeof define === 'function' && define.amd) { | |
// AMD | |
define(['underscore', 'jquery', 'exports'], function(_, $, exports) { | |
// Export global even in AMD case in case this script is loaded with | |
// others that may still expect a global Backbone. | |
root.Backbone = factory(root, exports, _, $); | |
}); | |
} else { | |
// Browser globals | |
root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender)); | |
} | |
}(this, function(root, Backbone, _, $) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment