Closed isochronous closed 9 years ago
I definitely see the use-case for adding some sort of path-mapping support. I wonder what would be the best way to do so? Ideally dependo should be able to read the RequireJS path-mapping, so you don't need to keep those mappings in sync?
What do you think?
Personally, I think the path-mapping provided by requireJS is a great model for implementation. It's clear, the parsing logic has already been written for you (in requireJS itself), and if you use said logic, you'd also be providing support for per-module mappings (via the map config) and non-AMD files as well (via the shim config). I bet James Burke would be willing to provide feedback on any effort you make towards this issue.
Agreed. This seems the way to go.
Kenneth Auchenberg +45 53 22 22 33
On Sat, Apr 13, 2013 at 9:09 PM, Jeremy McLeod notifications@github.comwrote:
Personally, I think the path-mapping provided by requireJS is a great model for implementation. It's clear, the parsing logic has already been written for you (in requireJS itself), and if you use said logic, you'd also be providing support for per-module mappings (via the map config) and non-AMD files as well (via the shim config). I bet James Burke would be willing to provide feedback on any effort you make towards this issue.
— Reply to this email directly or view it on GitHubhttps://github.com/auchenberg/dependo/issues/3#issuecomment-16338877 .
Agreed, this would be a very nice feature. As is, the generated visualization contains duplicate entries for each module (module identifier + file path). Great script, though!
+1 for this issue. BTW, the node-madge lib (https://github.com/pahen/madge) you mention in description do support requirejs config files, so maybe you just have to expose this bit of underlying API?
Dependo simply forwards the config to madge, so you should be able to pass requireConfig
as part of the options, to get things working as expected.
I updated the read-me.
Awesome, thanks man.
I apologize if this is something you've already added and I just haven't figured out yet, but the reason I never used any of the graphviz-based tools was that our project is heavily dependent on custom
paths
mapped inside arequire.config
call. Can dependo use such a file to resolve file mappings, or does it do it automatically assuming you've got the correct "entry point" script? Or is this too specific to requireJS AMD implementations?