What is the purpose of tsconfig.json in Angularjs?
It allows us to specify the root level files. The compiler options required to compile a TypeScript project. It determines that the said directory is the TypeScript project root. Here is a JSON file describing to define a tsconfig.json file containing different parameters of the compilerOptions property:
{
"compilerOptions": {
"noImplicitAny": true,
"module": "system",
"removeComments": true,
"strictNullChecks": true,
"sourceMap": true,
"allowUnreachableCode": false,
"outFile": "../JS/TypeScript/BestInterviewQuestion.js"
}
}
Here is an example of these options.
- target: It is used for the compiled output.
- module: It is used in the compiled output. the system is for SystemJS, common for CommonJS.
- moduleResolution: It is used to resolve module declaration files (.d.ts files). With the node approach, they are loaded from the node_modules.
- sourceMap: generate or not source map files to debug your application.
- emitDecoratorMetadata: emitDecoratorMetadata emit or not design-type metadata for decorated declarations in the source.
- experimentalDecorators: It enables or not experimental support for ES7 decorators,
- removeComments: remove comments or not
- noImplicitAny: It is used to allow or not the use of variables.
BY Best Interview Question ON 24 Jun 2020