I'm working in a project with backbone-boilerplate which uses RequireJS to load modules and JamJS to manage them.
My require config.js
file is as follows:
require.config({
deps: ["../vendor/jam/require.config", "main"],
paths: {
"backbone.localStorage": "../vendor/backbone.localStorage-1.0/backbone.localStorage"
},
shim: {
"backbone.localStorage": {
deps: ['backbone']
}
}
});
As you can see the RequireJS load config from jam config file jam/require.config.js
which specifies backbone, jquery and underscore. Next is a piece of the file:
"packages": [
{
"name": "backbone.layoutmanager",
"location": "../vendor/jam/backbone.layoutmanager",
"main": "backbone.layoutmanager.js"
}
{
"name": "backbone",
"location": "../vendor/jam/backbone",
"main": "backbone.js"
}
],
"version": "0.2.11",
"shim": {
"backbone.layoutmanager": {
"deps": [
"jquery",
"backbone",
"lodash"
],
"exports": "Backbone.LayoutManager"
}
"backbone": {
"deps": [
"jquery",
"lodash"
],
"exports": "Backbone"
}
}
};
What I want is to specify in my config.js
the backbone.localStorare library depends on backbone defined in the package section.
Also if I specify the backbone path as follows, then it found backbone library but an error message is found saying underscore is not loaded:
require.config({
deps: ["../vendor/jam/require.config", "main"],
paths: {
"backbone": "../vendor/jam/backbone/backbone",
"backbone.localStorage": "../vendor/backbone.localStorage-1.0/backbone.localStorage"
},
shim: {
"backbone.localStorage": {
deps: ['backbone']
}
}
});
I could add backbone.localStorage library using jamjs but the version of the available package is old so I prefer to download the last one manually and include by hand.
Any ideas or help will be appreciated.