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

ts config alias does not work at all #399

Open
Arichy opened this issue Jan 20, 2024 · 9 comments
Open

ts config alias does not work at all #399

Arichy opened this issue Jan 20, 2024 · 9 comments

Comments

@Arichy
Copy link

Arichy commented Jan 20, 2024

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

  • src/index.tsx: ["src/pages/page1/index.tsx"]
  • src/pages/page1/index.tsx: ["src/pages/page1/index.module.scss"]

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
Copy link

Delagen commented Jan 31, 2024

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

@guillaumebrunerie
Copy link

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
Copy link
Author

Arichy commented Feb 2, 2024

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
Copy link
Author

Arichy commented Feb 2, 2024

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
Copy link

Delagen commented Feb 2, 2024

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
Copy link

huntye1 commented Feb 18, 2024

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
Copy link

huntye1 commented Feb 19, 2024

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
Copy link

Delagen commented Feb 19, 2024

@huntye1 I always set this option)

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

@dyllandry
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants