The following main.js
code do not respect the order of priorities (sometimes underscore.js
is not loaded when backbone.js
needs it):
I recently updated the RequireJS docs, but I have not pushed the change to the site yet:
The "priority" configuration cannot load resources loaded by plugins. So to accomplish what you are trying to do, you can just nest require() calls, which will give you the behavior you want:
require(
{
baseUrl:'/scripts'
},
[
"require",
"order!http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js",
"order!http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js",
"order!http://ajax.cdnjs.com/ajax/libs/underscore.js/1.1.6/underscore-min.js",
"order!http://ajax.cdnjs.com/ajax/libs/backbone.js/0.3.3/backbone-min.js"
],
function (require) {
require(["src/app"], function (app) {
app.start();
});
}
);
This assumes you have the order plugin in the /scripts/order.js location.