pahen / madge

Create graphs from your CommonJS, AMD or ES6 module dependencies
MIT License
9.08k stars 317 forks source link

ts config alias does not work at all #399

Open Arichy opened 10 months ago

Arichy commented 10 months ago

I'm testing this lib, and find some problems. I have a test folder with dependencies:

But when I run yarn build which runs node scripts/build.js, madge listed dependencies of src/index.tsx as an empty array instead of including src/pages/page1/index.tsx

with extends in tsconfig:

image

without extends in tsconfig:

image
Delagen commented 10 months ago

I installed madge globally, manually updated dependencies dependency-tree and detective-typescript, and seems it solves my task with tsconfig aliases

guillaumebrunerie commented 10 months ago

I had a similar issue and I managed to fix it by adding "baseUrl": "." to my tsconfig.json (despite this option being deprecated: https://www.typescriptlang.org/tsconfig#baseUrl)

Arichy commented 9 months ago

I had a similar issue and I managed to fix it by adding "baseUrl": "." to my tsconfig.json (despite this option being deprecated: https://www.typescriptlang.org/tsconfig#baseUrl)

But there are already baseUrl : "src" in my config.

Arichy commented 9 months ago

I installed madge globally, manually updated dependencies dependency-tree and detective-typescript, and seems it solves my task with tsconfig aliases

What are the respective versions did you update to manually?

Delagen commented 9 months ago

I installed madge globally, manually updated dependencies dependency-tree and detective-typescript, and seems it solves my task with tsconfig aliases

What are the respective versions did you update to manually?

Simply latest

huntye1 commented 9 months ago

I installed madge globally, manually updated dependencies dependency-tree and detective-typescript, and seems it solves my task with tsconfig aliases

What are the respective versions did you update to manually?

Simply latest

that's not work for me ... and adding "baseUrl": "." to tsconfig.json work

huntye1 commented 9 months ago

I installed madge globally, manually updated dependencies dependency-tree and detective-typescript, and seems it solves my task with tsconfig aliases

What are the respective versions did you update to manually?

Simply latest

that's not work for me ... and adding "baseUrl": "." to tsconfig.json work

Finally, i solved this problem with option basedir. Cause I run madge cmd in another package dir of monorepo, it work right

Delagen commented 9 months ago

@huntye1 I always set this option)

Now it work from the box or need to update dependencies?

dyllandry commented 4 months ago

I think I'm running into the same issue, what did you set basedir to that solved it? Madge works with vue as well unless I run madge from outside the project's directory.