TypeScript Compiler Options
generateTrace — TypeScript compiler diagnostics
Writes a compiler event trace and a type inventory to a directory. Use these artifacts to investigate expensive checking and type relationships. The generated JSON is diagnostic data, not a stable application API; size and contents vary and may expose project paths and type names. Use a fresh directory for each capture. Baseline: TypeScript 5.8.3. Default: disabled unless requested. Create the labeled files in an isolated directory and run the commands below. The trace directory contains parseable trace.json and types.json files.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "generateTrace": "trace" }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| generateTrace | string | Compiler option; default: disabled unless requested. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES5", "module": "CommonJS", "lib": [ "ES5" ], "strict": true, "types": [], "outDir": "dist", "noEmitOnError": true, "generateTrace": "trace", "noEmit": true }, "files": [ "index.ts" ]}// File: index.ts (omit this label)type Box<T> = { value: T };export const box: Box<number> = { value: 7 };
// Run these commands in order in an isolated project:// tsc -p . --pretty false