Skip to content

Instantly share code, notes, and snippets.

@aackerman
Created August 5, 2012 14:53
Show Gist options
  • Save aackerman/3265224 to your computer and use it in GitHub Desktop.
Save aackerman/3265224 to your computer and use it in GitHub Desktop.
Require JS Example Config
require.config({
name: 'libs/almond/almond',
baseUrl: '/js/',
paths: {
'lodash' : 'libs/lodash/lodash',
'Backbone' : 'libs/backbone/backbone',
'Hogan' : 'libs/hogan/hogan',
'App' : 'views/App',
'SessionView' : 'views/Session',
'SessionModel' : 'models/Session',
'StackView' : 'views/Stack',
'NewStackPrompt' : 'views/NewStackPrompt',
'NewCardPrompt' : 'views/NewCardPrompt',
'StackModel' : 'models/Stack',
'FlashcardView' : 'views/Flashcard',
'FlashcardModel' : 'models/Flashcard',
'FlashcardCollectionView' : 'views/FlashcardCollection',
'FlashcardCollection' : 'collections/FlashcardCollection',
'ctemplates' : 'modules/ctemplates'
},
include: ['main'],
insertRequire: ['main'],
shim: {
'Backbone': {
deps: ['lodash', 'jquery'],
exports: 'Backbone'
},
'lodash': {
exports: '_'
}
},
out: 'main-built.js',
wrap: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment