-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Transpile to JS considering paths from tsconifg #18951
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
Please see #16640 |
Ok, I see, but there is was no strong reasoning why this should not be implemented. Yes, loaders can do it. But nodejs can not, would require to use some not standard way. Also, it would really simplify configuration because would be no need to configure loaders for this. And of course, this should be the optional feature, who want to live old way - always will. I mean, TS could make a goodness for devs. I propose to think about it again (invite others team members), maybe there are strong reasons not to do this, but maybe not. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
For convenience to get rid of relative paths one may use:
For this to work in tsconfig I have:
Transpired JS still have
require('~/shared')
andnode
will fail to find the module. Loaders like webpack has mechanics for this, butnode
as a standard runtime for JS AFAIN has not standardized/common approach to handle such paths correctly.So if TS uses
paths
for looking up of the modules, why for convenience not convert such paths to relative to module paths sonode
(and other loaders) could require it? This probably should be a compiler option.What do you think? Am I missing something why it can not be implemented? Maybe some unsafe/irrelevant cases of paths mapping?
The text was updated successfully, but these errors were encountered: