Curriculum
Course: TypeScript
Login
Text lesson

Configuring the compiler

By default, the TypeScript compiler shows a help message in an empty project, but you can configure it using a tsconfig.json file, which can be generated with recommended settings using a specific command.

npx tsc –init

This will produce an output similar to:

Created a new tsconfig.json with:
TS
  target: es2016
  module: commonjs
  strict: true
  esModuleInterop: true
  skipLibCheck: true
  forceConsistentCasingInFileNames: true

You can learn more at https://aka.ms/tsconfig.json

Here is an example of additional configurations you might include in the tsconfig.json file:

{
  “include”: [“src”],
  “compilerOptions”: {
    “outDir”“./build”
  }
}