0Pricing
Frontend Academy · Lesson

Compiling TS and tsconfig.json

Run tsc to compile TypeScript, configure the compiler with tsconfig.json options like strict, target, and outDir.

Installing the TypeScript Compiler

Install TypeScript as a dev dependency. The tsc CLI compiles TypeScript files. With Vite or Next.js, the bundler handles compilation — but tsc is still used for type checking.

npm install --save-dev typescript
npx tsc --version  # verify installation
npx tsc app.ts     # compile a single file

Initialising tsconfig.json

Run npx tsc --init to generate a tsconfig.json with all options commented out and sensible defaults. This file is the single configuration for the TypeScript compiler.

npx tsc --init
# Creates tsconfig.json with ~100 commented-out options

All lessons in this course

  1. Why TypeScript: Types Catch Bugs at Compile Time
  2. Primitive Types Unions and Type Aliases
  3. Interfaces and Object Types
  4. Compiling TS and tsconfig.json
← Back to Frontend Academy