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
Output for modules currently uses resolved path, would like the ability to use module path if it exists.
Current Behavior
Currently the path for sub modules, if using things like npm linking and webpack resolve gives you the relative path, ie ../../
This is ugly, i'd prefer to use the unresolved module path
The text was updated successfully, but these errors were encountered:
hi @pixeldrew - agree with you on the aesthetics of ../../ vs using the unresolved path names. I'll put it on the backlog as a suggestion. The solution will have to find a sensible default, though, to prevent unexpected output:
For aliased (i.e. mapped through tsconfig/ webpack paths, or webpack aliases) modules it makes sense to use the unresolved path name. There can be multiple aliases for the same module, although that does seem to be an edge case.
It's probably not a good idea for non-aliased (i.e. regular local or external) dependencies - various modules will have a different path to other modules. So the same file can end up in the dot output multiple times E.g. for the local ./hello.ts below:
./index.ts:
import*from'./hello'
...
./subdir/bla.ts:
import*from'../hello'
would yield a graph with four modules instead of three (index, ./hello, ./subdir/bla and ../hello)
in both cases the unresolved path is a property of the dependency, and not of the target module (see diagram below) - it's just how another module sees that target module; so there'd probably be a need to pick something for aliases and attach that to the module...
Expected Behavior
Output for modules currently uses resolved path, would like the ability to use module path if it exists.
Current Behavior
Currently the path for sub modules, if using things like npm linking and webpack resolve gives you the relative path, ie ../../
This is ugly, i'd prefer to use the unresolved module path
The text was updated successfully, but these errors were encountered: