Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to retrieve requirejs child recursive dependencies #57

Closed
Baccanno opened this issue Apr 26, 2015 · 6 comments
Closed

Unable to retrieve requirejs child recursive dependencies #57

Baccanno opened this issue Apr 26, 2015 · 6 comments
Assignees
Milestone

Comments

@Baccanno
Copy link

The analyse always stops at the first layer and consider my dependencies to have no deps, which is of course not the case.

using madge -f amd -R myconf.js -N -i out.png src

@craiggoldstone
Copy link

@Baccanno - I think that's the same root issue as the one I opened last week (#56). Do you have the same project setup where the baseUrl doesn't reflect the same location as the local file system?

@TooBug
Copy link

TooBug commented Jul 8, 2015

any update on this?

@Baccanno
Copy link
Author

Baccanno commented Jul 8, 2015

Sorry I did not continue using Madge, I resolved my issue by isolating the file that was causing trouble and load it first in its own require() callback.

@colorpump
Copy link

Same problem here: The child dependencies in my amd project are not shown.
I broke it down to a simple example.
directories:

www/
  app/
    main.js
    math.js
    messages.js
  lib/
    print.js
  config.js

I made sure that baseUrl reflects the same location as I call the madge cmd.
config.js:

requirejs.config({
    baseUrl: '../',  // path outside of the www folder
    paths: {
      // I left paths emtpy as madge doesn't seem to recognize them
    }
});

main.js:

define(['www/app/messages', 'www/lib/print'],

print.js:

define(['www/app/math']

command:

madge  ./www/app/main.js --format amd --find-nested-dependencies --dot > graph.gv

output:

digraph G {
  "main";
  "www/app/messages";
  "www/lib/print";
  "main" -> "www/app/messages";
  "main" -> "www/lib/print";
}

But I miss "www/lib/print"->"www/app/math'"

@colorpump
Copy link

I saw in #67 that what I'm loking for, is not implemented. I want to see the whole dependency tree. That's just possible if calling madge ./whole_directory but that shows me also files, which are never been called. To optimize each time my project just to run madge on it, would be annoying. A flag to get recursive dependencies, would be really nice. Until than I use a code snippet which gives me the wished result in the Browser console (also annoying): rtree.js

@pahen
Copy link
Owner

pahen commented Jul 6, 2016

I'm refactoring Madge now and planning to release 1.0.0 soon and will try to have this fixed then.

@pahen pahen self-assigned this Aug 5, 2016
@pahen pahen modified the milestone: 1.0 Aug 8, 2016
@pahen pahen mentioned this issue Aug 16, 2016
@pahen pahen closed this as completed in #96 Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants