Skip to content

Instantly share code, notes, and snippets.

@amiorin
Last active December 17, 2015 23:38
Show Gist options
  • Save amiorin/5690279 to your computer and use it in GitHub Desktop.
Save amiorin/5690279 to your computer and use it in GitHub Desktop.
Require.js configuration with Backbone, Mocha and Chai
require.config({
urlArgs: "v=" + (new Date()).getTime(),
paths: {
jquery: 'libs/jquery',
underscore: 'libs/lodash',
backbone: 'libs/backbone',
text: 'libs/text',
ast_model: 'app/models/ast_model',
foo_model: 'app/models/foo_model',
debug_view: 'app/views/debug_view',
workbench_view: 'app/views/workbench_view',
mocha: 'spec/libs/mocha',
chai: 'spec/libs/chai',
ast_model_spec: 'spec/models/ast_model_spec',
},
shim: {
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
mocha: {
deps: ['chai'],
init: function(chai) {
chai.should();
mocha.setup('bdd');
return mocha;
}
}
}
});
require([
'app'
], function(app){
app.initialize();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment