dividab / tsconfig-paths

Load node modules according to tsconfig paths, in run-time or via API.
MIT License
1.82k stars 104 forks source link

Added support for absolute paths #147

Closed mprinc closed 2 years ago

mprinc commented 4 years ago

tsconfig-paths doesn't follow regular paths resolution (#101) I can provide a minimal repo, but nevertheless, tsc will not append baseUrl to the path mapping that is absolute

This change is "breaking" change for someone that was using absolute mappings, but as the absolute mappings were not working as expected, it is not highly likely that it will really break anyone's code.

Still, there might be a good idea to make it possible to enable the legacy mode (I can extend the PR) or, even keep the legacy mode as default (since I think the current mode is a bug, I suggest against this idea if possible?)

aleclarson commented 2 years ago

Hard to tell what logic you changed with all the whitespace changes. Can you fix those?

mprinc commented 2 years ago

Great to hear back from you, as we still live on a separate clone of the official version :)

How do you suggest I do it? Clone again and re-apply changes or somehow (how?) transform this PR?

aleclarson commented 2 years ago

You can try re-commiting with the following commands:

git reset --mixed head^
git diff -U0 -w --no-color | git apply --cached --ignore-whitespace --unidiff-zero -
git commit -m 'feat: support absolute paths in `paths` mapping'

(Ripped from https://stackoverflow.com/questions/3515597/add-only-non-whitespace-changes)

aleclarson commented 2 years ago

@jonaskello This is a duplicate of #184. Close it please :)