Reputation: 843
Is there a way to print the options used by tsc
? I feel like it doesn't take my tsconfig.json
into account and I'm looking for a flag that would allow me to know what kind of options it's trying to use.
Upvotes: 22
Views: 7285
Reputation: 19371
tsc --showConfig
will show the complete config that will be used for compilation.
The --showConfig
flag has been added in typescript 3.2:
TypeScript will calculate the effective tsconfig.json (after calculating options inherited from the extends field) and print that out. This can be useful for diagnosing configuration issues in general.
Description from the compiler options documentation:
Rather than actually execute a build with the other input options and config files, show the final implied config file in the output.
Upvotes: 32
Reputation: 2575
Currently there is no option to dump the loaded configuration.
You may want to upvote the issue:
Edit: tsc --showConfig
has been implemented as of v3.2.1.
Upvotes: 6
Reputation: 752
I think you should provide a better question maybe with some more information, like what your tsconfig.json
looks like, where is it placed, is it in the root of the project, are there any errors on compile etc.
The simplest way to test if Typescript compiler
takes your tsconfig.json
in consider is to make a typo in that JSON or make that JSON not valid. If Typescript compiler
uses your tsconfig.json
then it will fail with an error.
Upvotes: 0