I'm trying to build my single page application that uses Require.js, AMD style modules.
I already configured all the dependencies, paths and shims in my init.js
file that runs first and then calls my main.js
file.
Here is my init.js
file :
(function() {
'use strict';
var me = this;
me.require.config({
deps: ['backbone.marionette', 'main'],
shim: {
jquery: {
exports: 'jQuery'
},
underscore: {
exports: '_'
},
backbone: {
deps: [
'underscore',
'jquery'
],
exports: 'Backbone'
},
'backbone.marionette': {
deps: ['jquery', 'underscore', 'backbone'],
exports: 'Marionette'
}
},
paths: {
jquery: '../lib/jquery/dist/jquery.min',
html5shiv: '../lib/html5shiv/html5shiv.js',
underscore: '../lib/underscore/underscore-min',
backbone: '../lib/backbone/backbone',
'backbone.marionette': '../lib/backbone.marionette/lib/core/amd/backbone.marionette.min',
'backbone.wreqr': '../lib/backbone.wreqr/lib/amd/backbone.wreqr.min',
'backbone.babysitter': '../lib/backbone.babysitter/lib/amd/backbone.babysitter.min',
text: '../lib/requirejs-text/text'
}
});
}).call(this);
and here is my r.js
build config file :
({
baseUrl: '../../development/js',
optimize: 'closure',
paths: {
requireLib: '../lib/requirejs/require'
},
mainConfigFile: '../../development/js/init.js',
out: '../../distribution/main-build.js',
include: ['requireLib']
})
When I build, I only get Require.js inlined in my main-build.js
file.
R.js doesn't follow the deps
property defined in the require.config for some reason.
- Any ideas on how to get a single file containing my Backbone.js / Marionette.js files and the dependencies described in the
require.config
found in the init.js
file ?
Thanks in advance !