25

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.

2

3 Answers 3

34
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.

Sign up to request clarification or add additional context in comments.

Comments

8

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.

Comments

-1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.