You can store the TS compiler configuration in the file called tsconfig.json
. You’ll usually add this file to the root directory of your project, together with the package.json
.
When you launch the compiler, it reads the tsconfig.json
from the folder you launched it from, to get the instructions about how to compile your project (e.g., which source files to compile, where to store the output, etc).
The compiler reads the tsconfig.json
from the folder where you run it. Also, you can tell the compiler where to look for the config using the -p
option:
tsc -p tsconfig.server.json
The structure of the tsconfig.json
looks like this: