Configuring TypeScript compiler options

We need to inform Visual Studio about the compiler options required to compile TypeScript for our application to consume when it is running. With the help of a TypeScript configuration file, we can configure the compiler options and other details using the following steps:

  1. Let's add TypeScript Configuration File by right-clicking on the project and navigating to Add | New Item in the menu, leaving the filename to default, as shown in this screenshot:
Adding the TypeScript configuration file

A file named tsconfig.json will be added to the project root directory.

  1. Replace the content of the TypeScript configuration file with the following configuration:
      {   
"compilerOptions":
{
"diagnostics": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es2015", "dom"],
"listFiles": true,
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"outDir": "wwwroot",
"removeComments": false,
"rootDir": "wwwroot",
"sourceMap": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5"
},
"exclude": [
"node_modules"
]
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.187.233