Generate tsconfig.json

Create a TypeScript compiler configuration with options, globs, and aliases.

freeworks offlinenothing uploaded
Tooltsconfig.json Generator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Compiler options, include and exclude globs, module settings, and path aliases are serialized as a tsconfig JSON object. The file configures tsc and editors but does not compile the project.

  • Strict checking and a separate output directory are common starts.
  • Target and module choices must match the runtime.

Worked example

Next.js tsconfig
Generate a tsconfig.json for a Next.js project
Input
											Target: ES2022
Module: ESNext
Framework: nextjs
Strict: true
Declaration: false
Source map: true
Out dir: dist
Root dir: src
Jsx: none
Paths: true
										
Output
												Name: next
											

When to use this

New packages, IDE diagnostics, and build pipelines create tsconfig files.

Edge cases

  • Globs can omit a source file.
  • Path aliases need matching runtime or bundler resolution.
  • noEmit type-checks without producing JavaScript.

References