Remove usage of baseUrl from nx apps tsconfig.base.json #31877
mattlewis92
started this conversation in
Feature Requests
Replies: 1 comment 1 reply
-
Does this work in typescript-go with just a baseUrl change? I did not get it to work recently if it had path aliases, as stated in, microsoft/typescript-go#516 (comment) and thought we would need to move to workspaces which nx does not offer a migration for, stating in https://nx.dev/technologies/typescript/recipes/switch-to-workspaces-project-references "We are investigating automating parts of this process with generators" |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have been experimenting with the typescript-go port on our repo, and one of the issues we ran into was caused by nx setting the
baseUrl
property in thetsconfig.base.json
to"."
and issues surfacing due to people's IDEs inserting absolute imports likeimport foo from 'libs/my-lib/src/lib/some-file'
instead of using the path mapping.It looks like the intent is for typescript to drop the baseUrl option in the go port: microsoft/typescript-go#1299
As according to the docs,
baseUrl
was only designed for the AMD module system and is not recommended:It would be great if nx could provide a migration that:
baseUrl
from the roottsconfig.base.json
paths
in thetsconfig.base.json
to be prefixed with./
Then all nx library generators are updated when adding new path mappings to add the
./
prefix e.g.Before:
After:
Beta Was this translation helpful? Give feedback.
All reactions