what is the purpose of tsconfig.json?

后端 未结 5 1788
情歌与酒
情歌与酒 2020-12-13 12:54

I was reading angular2 referrences and found this tsconfig.json. I would like to know what the following parameters mean?

{
    \"compilerOption         


        
5条回答
  •  半阙折子戏
    2020-12-13 13:31

    Most of points are covered above. some are missed which i like to highlight.

    tsconfig.json will tell where is build code and which version to target.

    For instance, when it goes to production it will refer the below key in tsconfig.json and pick the build.

    "outDir": "./dist/out-tsc", --> where to locate the build file. 
    

    And our browser do not understand typescript so mention which type of js to convert our code which will be understood by browser.

    In other words, we write our code in typescript but bring that code to es5, We do that using the below field.

      "target": "es2015",
    

提交回复
热议问题