Configuring the TypeScript compiler

Now that everything is set up with npm, we can turn our focus to TypeScript.

Typically, the first thing to do in any TypeScript project is to create the compiler configuration file. So, indeed, at this point, you need to be aware of the fact that the TypeScript compiler can be configured through a file called tsconfig.json. The presence of a tsconfig.json file in a folder tells TypeScript that the folder is the root of a TypeScript project.

Through tsconfig.json, you can precisely configure the compiler, adapting it to your project and its specific needs.

To get started, create a default configuration file using npm run compile -- --init.

Do you remember npm <script_name> -- <arguments>? This is how you ...

Get Learn TypeScript 3 by Building Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.