I am trying to wrap my head around dependencies in requirejs.
- If I already declared dependencies for a file with
shim, do I need to re-declare it when I define a module in this file? - If I use
requiredependencies such as a trunk to load, do I need to re-declare this when I define a module that loads as part require?
Here is my code:
require.config({
paths: {
Backbone: 'libs/backbone-min',
Config: 'config',
Dom: 'dom',
App: 'app'
},
shim: {
'Backbone': ['libs/underscore-min'],
'Dom': ['libs/sizzle']
}
});
require(['Config','Dom','App','Backbone'], function(){
});
So, in dom.jscan I just identify the module with define(function(){...});and start using Sizzle? Or I still need to define it like this:define(['libs/sizzle'], function(){...});
Also, if I define a module in app.js, I still need to load the trunk into define, since I already included it as part of it require().
user1187135