tsconfig-paths
tsconfig-paths copied to clipboard
Undocumented Feature: Using cwd to pass custom tsconfig.json path
Hi,
I was trying to figure out how to use a custom tsconfig path (in my project we use tsconfig.json for a "base" config file, then we have tsconfig.server.json and tsconfig.tests.json each of which extend the base tsconfig.json file.
I was trying to find an option to pass the .tests config file, but couldn't find it. I think stumbled on this undocumented feature. If cwd option points to a file, it will be used as the path to tsconfig.json.
This should either be documented or (even better) should be exposed as a more explicit/obvious option and documented in README.
https://github.com/dividab/tsconfig-paths/blob/80bc8106ee580dea5d379e462fdd4cbeb43ecfcf/src/tsconfig-loader.ts#L74-L76