Skip to content

Instantly share code, notes, and snippets.

@whitlockjc
Created December 12, 2012 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whitlockjc/4263880 to your computer and use it in GitHub Desktop.
Save whitlockjc/4263880 to your computer and use it in GitHub Desktop.
Example showing how to use Require.js to load Backbone.js and its dependencies (jQuery and Underscore.js).
require.config({
paths: {
jquery: 'libs/jquery/jquery.min',
underscore: 'libs/underscore/underscore.min',
backbone: 'libs/backbone/backbone.min',
bootstrap: 'libs/bootstrap/bootstrap.min'
},
shim: {
'underscore': {
exports: '_'
},
'backbone': {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
'bootstrap': {
deps: ['jquery']
}
}
});
// The rest of your main.js would go here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment