Skip to content

Instantly share code, notes, and snippets.

@justinfay
Created February 4, 2013 11:56
Show Gist options
  • Save justinfay/4706331 to your computer and use it in GitHub Desktop.
Save justinfay/4706331 to your computer and use it in GitHub Desktop.
// Set the aliases for the libraries used in the application
require.config({
paths: {
jquery: 'libs/jquery-min',
underscore: 'libs/underscore-min',
backbone: 'libs/backbone-min',
request: 'libs/XMLHttpRequest',
mustache: 'libs/mustache-min',
templates: '../templates',
collapse: 'libs/bootstrap-collapse',
tab: 'libs/bootstrap-tab',
tooltip: 'libs/bootstrap-tooltip'
},
// The shim for non AMD modules eg. Backbone and _
// These require the dependencies that must be loaded prior to them
shim: {
jquery: {
exports: '$'
},
underscore: {
exports: '_'
},
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
collapse: {
deps: ['jquery'],
exports: 'jQuery.fn.collapse'
},
tab: {
deps: ['jquery'],
exports: 'jQuery.fn.tab'
},
tooltip: {
deps: ['jquery'],
exports: 'jQuery.fn.tooltip'
}
}
});
require([
// Load our app module and pass it to our definition function
'app',
], function(App){
App.initialize();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment