Is it possible to use almond with a multipage setup as follows:
common.js is loaded on all pages & contains almond, bootstrap & jquery
main1.js is loaded only on page 1 & contains almond, and app/main1.js which requires jquery. When i run the build for main1.js i am excluding bootstrap & jquery since it is in common.
on page1 common.js & main1.js are loaded but, i get an error: Uncaught Error: app/main1 missing jquery
.
Is it possible to do this with almond or am I doing something wrong?
UPDATE: I am useing django-require which converts python objects to command line entries for r.js, further more it renames the supplied modules to 'almond' and adds the named module to the include (this may be what is causing my error?). Also note, django-require does not permit include/exclude for REQUIRE_STANDALONE_MODULES, i added this functionality:
REQUIRE_STANDALONE_MODULES = {
"common": {
"out": "common.js",
"include": ["bootstrap", "jquery"],
"build_profile": "module.build.js"
},
"main1": {
"out": "main1.js",
"exclude": ["bootstrap", "jquery"],
"build_profile": "module.build.js"
}
}
Main1.js
require(['app/main1']);
This translates to a build file entry like this:
modules = {
"almond": {
"out": "common.js",
"include": ["common", "bootstrap", "jquery"],
"build_profile": "module.build.js"
},
"almond": {
"out": "main1.js",
"include:"main1",
"exclude": ["bootstrap", "jquery"],
"build_profile": "module.build.js"
}
}