Skip to content

Instantly share code, notes, and snippets.

@justjohn
Created February 21, 2012 15:36
Show Gist options
  • Save justjohn/1877060 to your computer and use it in GitHub Desktop.
Save justjohn/1877060 to your computer and use it in GitHub Desktop.
Wrappers for Backbone and Underscore as CommonJS Modules/2.0
// NEW underscore.js
module.declare([], function (require, exports, module) {
// Contents of underscore.js
// Backbone expects require("underscore") to be _
// so let's make it so.
exports._.extend(exports, exports._);
});
// NEW backbone.js
module.declare(
[ { underscore: "location/to/wrapped/underscore" } ]
, function (require, exports, module) {
// Contents of backbone.js
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment