Open ersinakinci opened 4 years ago
This is also a problem with just importing ts files, as the file-extension is not included
hope to implement,This is a massive problem during i use this。
I'm having this issue too with basepaths and aliases, but this is still a great extension :+1:
I've configured my
tsconfig.json
with abaseUrl
set to./app/javascript
. So I writeimport { foo } from 'utility'
and it imports from./app/javascript/utility
. Dependency Cruiser, however, seesutility
as a top-level import and shows me a graph like this: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:utility
, which is in./app/javascript/utility
, andreact
, which is in./node_modules/react
.tsconfig.json
supportsbaseUrl
as well as specific path aliases usingpaths
(e.g.,@utility
-->./app/javascript/utility
).jsconfig.json
has options similar totsconfig.json
but for VS Code (doesn't depend on TS).module-resolver
plugin hasroot
andalias
config options.resolve
options.Perhaps the easiest way to handle the myriad cases is to simply create
baseUrl
,paths
andexternals
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.