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

Respect Babel/TS/Webpack/whatever base paths, aliases and externals #4

Open
ersinakinci opened this issue Sep 8, 2020 · 3 comments

Comments

@ersinakinci
Copy link

ersinakinci commented Sep 8, 2020

I've configured my tsconfig.json with a baseUrl set to ./app/javascript. So I write import { foo } from 'utility' and it imports from ./app/javascript/utility. Dependency Cruiser, however, sees utility as a top-level import and shows me a graph like this:

Ekran Resmi 2020-09-07 ÖS 5 37 34

It would be really great to see Dependency Cruiser follow Babel/TS/Webpack/whatever's config for base paths and show imports like utility coming from the right place. Here's a non-exhaustive list of details that would need to be addressed:

Perhaps the easiest way to handle the myriad cases is to simply create baseUrl, paths and externals settings in the plugin's config and allow users to manually specify the base path, aliases and any external module declarations.

One last consideration: if you let users declare the base path, they will probably need to give an absolute path since VS Code could be launched from whatever pwd. Not sure whether there's a way around that.

@ersinakinci ersinakinci changed the title Respect Babel/TS/Webpack/whatever base paths Respect Babel/TS/Webpack/whatever base paths, aliases and externals Sep 8, 2020
@N0tExisting
Copy link

This is also a problem with just importing ts files, as the file-extension is not included

@a931528933
Copy link

hope to implement,This is a massive problem during i use this。

@rfgonzalezweb
Copy link

I'm having this issue too with basepaths and aliases, but this is still a great extension 👍

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

4 participants