-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Suggestion: Transpile path mappings based module resolution imports to relative paths #6710
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
Comments
Can you elaborate on the use case here. |
please reopen if you have more information. |
@mhegazy : to avoid opening another issue with the same topic, I'd like to pitch in. I assumed that this conversion to relative paths was part of these new ts 2.0 features, but just like @dsherret I fail to find relevant documentation for this scenario ps. Feel free to correct me if I reinterpret you incorrectly @dsherret ;) |
Yes, basically I think it would be extremely nice if the emitter handled emitting the module specifier to a relative path if the module specifier is resolved using baseUrl, path mappings, or rootDirs. Right now it emits So current problems:
It would be nice if the emitter would handle all this. That would mean that I would only need to keep this configuration in tsconfig.json. |
Taking example 2 from the original issue (#5039):
When doing...
...in
file3.ts
it current compiles to the same thing as above. Would it be possible if we could add a compiler option or some way that would convert this to the relative path? So it would transpile it to:That way the paths don't have to be managed in two places. I couldn't find this discussed anywhere and didn't want to clutter the original issue so I'm opening this here.
The text was updated successfully, but these errors were encountered: