How to detect circular dependencies from a project built using requir.js?
For instance
/* File: MyView.js */
define(['backbone','views/myview','object_x'], function(BB,V,X){
...
});
/* File: Object_X.js */
define(['backbone','jquery','views/myview','object_x'], function(BB,$,V,X){
...
});
what I mean is that as the project gets bigger, manually inspecting each file becomes a hassle.
Edit: How about detecting redundant dependencies?
How to detect circular dependencies from a project built using requir.js?
For instance
/* File: MyView.js */
define(['backbone','views/myview','object_x'], function(BB,V,X){
...
});
/* File: Object_X.js */
define(['backbone','jquery','views/myview','object_x'], function(BB,$,V,X){
...
});
what I mean is that as the project gets bigger, manually inspecting each file becomes a hassle.
Edit: How about detecting redundant dependencies?
Share Improve this question edited Jun 2, 2013 at 23:07 user1406062 asked Jun 2, 2013 at 20:43 user1406062user1406062 8835 silver badges16 bronze badges2 Answers
Reset to default 22I Googled your title word-for-word, and this was the first result...
https://npmjs.org/package/madge
Use r.js to optimize the code. During build process it will list files that were included while building.
If you want to do more dependency graph analysis the semi-private onResourceLoad API may be helpful.