Created
December 12, 2012 00:55
-
-
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).
This file contains 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
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