dividab / tsconfig-paths

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

feat(register): add `cwd` param #205

Closed aleclarson closed 2 years ago

aleclarson commented 2 years ago

I'm hitting an edge case where my process.cwd() is not the value I want register to use.

This PR will let me circumvent that programatically.

require('tsconfig-paths').register({
  cwd: 'path/to/cwd',
})
jonaskello commented 2 years ago

Yes, this seems like a good idea :-) Could you update the README file to add this feature to the docs, and also the CHANGELOG file under the "Unreleased" heading?

aleclarson commented 2 years ago

Done ✅