WindowsmacOSLinux

Where Does TypeScript Put .tsbuildinfo Files?

TypeScript writes .tsbuildinfo files next to the output (or config) unless tsBuildInfoFile pins them elsewhere.

Last updated

With incremental (or composite) on, tsc records the project graph in .tsbuildinfo files so the next run only rechecks what changed. The default location depends on your other settings: next to outFile, inside outDir, or beside the tsconfig.

That wandering default surprises people. Pin tsBuildInfoFile explicitly (a build cache folder outside version control works well) and add the pattern to .gitignore once, instead of chasing stray files per project.

Where TypeScript stores this, by platform

Windows
[ProjectDir]\tsconfig.tsbuildinfo

Incremental graph data. Default: <outFile>.tsbuildinfo, or <outDir>/<config>.tsbuildinfo, or <config>.tsbuildinfo. Override with tsBuildInfoFile; gitignore the result.

macOS
[ProjectDir]/tsconfig.tsbuildinfo

Same defaults. Composite projects always emit these files, so references builds scatter them per project unless each sets tsBuildInfoFile.

Linux
[ProjectDir]/tsconfig.tsbuildinfo

Same layout. Deleting them never affects runtime code; it only costs one full rebuild to regenerate the graph.

Frequently asked questions

Can I delete .tsbuildinfo files safely?

Delete the .tsbuildinfo files and rebuild. They only record the last project graph for incremental builds; the next compile regenerates them from scratch.

Monorepo builds are flaky with incremental on. Why?

Give each project its own tsBuildInfoFile path. Sharing one file across projects makes them overwrite each other and produces slow or broken builds.

Notice an outdated path? Let us know.