You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on a vue project and running madge from outside the project directory, madge shows missing imports when the import uses tsconfig's paths option.
This will correctly work when madge is run from inside the project:
I've seen this issue #399 but I'm not sure what they set --basedir to to get it working. I've tried many different combinations.
I've gotten it working by setting in the project's tsconfig "baseUrl": "." but that could cause breaking behaviour in the project by favoring a relative import instead of one from node_modules.
The text was updated successfully, but these errors were encountered:
My current solution is when calling the madge module to provide a tsconfig object that uses my project's tsconfig and adds a baseUrl set to the path to the project's directory.
This works for now, but it can still cause breaking changes. If I understand the baseUrl docs correctly, if the project imports "my-module" it could now resolve to a local file "my-module.js" when they mean for it to resolve to a package in node_modules called "my-module". I don't think this is happening for any of my projects, but it is a reason why this solution isn't ideal.
Minimal reproducible example: https://github.com/dyllandry/vite-madge-mre
When working on a vue project and running madge from outside the project directory, madge shows missing imports when the import uses tsconfig's
paths
option.This will correctly work when madge is run from inside the project:
But when run from outside the project, it doesn't work:
I've seen this issue #399 but I'm not sure what they set
--basedir
to to get it working. I've tried many different combinations.I've gotten it working by setting in the project's tsconfig
"baseUrl": "."
but that could cause breaking behaviour in the project by favoring a relative import instead of one from node_modules.The text was updated successfully, but these errors were encountered: