Sunday, November 25, 2018

How to create tsconfig.json

The presence of a tsconfig.json file in a directory indicates that the directory is the root of a TypeScript project. The tsconfig.json file specifies the root files and the compiler options required to compile the project.

1. Open Visual Studio Code
2. Click on Terminal menu
3. Click 'New Terminal'
4. You will see that Terminal is open at the bottom-most screen of Visual Studio Code
5. Run below command


This will create a tsconfig.json file in your directory where you can define your configuration. VSCode will also start using this file once it finds it in your root directory.

6. We have to compile TypeScript file so that it converts them into JavaScript file. It will keep all the complied files in temp folder. We are not going to compile node_modules, so we have to exclude.

7. Finally you should update your tsconfig.json file as

Done!!!

No comments:

Post a Comment