-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Ability to extend compilerOptions's paths config #44589
Comments
There are a number of times something like Libs being the most annoying even in 'standard' circumstances without extending another tsconfig, but the fact that 'adding' a single lib, REMOVES ALL the default ones added by the "target" setting. And you can't even get a definitive list of what those libs were.. |
@xiejay97 Hi. Did you find a solution or workaround? |
@ArZargaryan There is no solution for me yet 😹 |
+1 This is something very important, what is a workaround for this? |
+1. That would be helpful if we could extend the |
It seems to me that since the paths are name/value, a simple merge should work, eg:
The semantics seem quite clear - use the paths in the base config (with resolution relative to that tsconfig file), and merge/overwrite any local ones (relative to the local tsconfig file). |
@jugglingcats where should these be made? |
+1 Would really fix stuff in big monorepos |
This comment was marked as off-topic.
This comment was marked as off-topic.
+1 same issue! NX + Remix + NestJS - need local and common paths |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Seems this issue was addressed and closed back in 2017 on #14527 due to the suggestion being "more confusing since paths are order dependent and the paths are relative to the baseUrl, and there are two in this case". Which strikes me as an obnoxiously arrogant and dismissive take. Especially considering this can easily be resolved by simply either appending or prepending the base config, and scoping the new paths to either the current config's baseUrl or the base's baseUrl. And considering the increasing need for composite configs with monorepos, this is no longer an edge case (if you could ever argue it was one). Seems like an anti-pattern to suggest we just repeat ourselves in multiple configs. |
Folks, there has been an ongoing proposal since November 2023. Let's contribute to the discussion to help get it going: #56436 |
Suggestion
I have a
tsconfig.base.json
file for the monorepo, it defined paths that all project can useEach project has own
tsconfig.json
, also defined paths that only for itselfUnfortunately, the
paths
would be overwritten.I have to add
tsconfig.base.json
paths item to each project.So, it's necessary to provide a solution for this case.
🔍 Search Terms
List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.
The text was updated successfully, but these errors were encountered: