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

fix: allow absolute baseUrl in tsconfig.json #174

Closed nwalters512 closed 2 years ago

nwalters512 commented 3 years ago

configLoader assumed that baseUrl would always be relative path, but the TypeScript compiler allows baseUrl to be an absolute path as well. This PR updates the configLoader to correctly compute absoluteBaseUrl if the baseUrl in the TypeScript config file is already absolute.

Note that the same thing was already being done if explicitParams was provided.

jonaskello commented 2 years ago

@nwalters512 Could you also add an entry for this PR in the CHANGELOG under unreleased heading ? With that it should be good to merge.

aleclarson commented 2 years ago

Hey @nwalters512, would you mind adding this to CHANGELOG.md and pushing it?

## [Unreleased]

### Fixed

- Let `baseUrl` in tsconfig be an absolute path. See PR [#174](https://github.com/dividab/tsconfig-paths/pull/174). Thanks to @nwalters512!
nwalters512 commented 2 years ago

I'm on it! Thanks for getting this reviewed.

aleclarson commented 2 years ago

@jonaskello LGTM