From f4338c9d6bffd8673962e8896874c69bf078762a Mon Sep 17 00:00:00 2001 From: Anso Date: Tue, 28 Apr 2026 09:15:54 -0400 Subject: [PATCH] perf(build): enable incremental tsc (#827) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit backend/tsconfig.json had no incremental setting, so every tsc run re-checked the full project from cold. The two frontend tsconfigs already declared a tsBuildInfoFile path under node_modules/.tmp/ but without incremental: true the file was never written, and the path itself sits inside node_modules where npm ci wipes it on every fresh install — neither of which actually persists incremental state. Add incremental: true to all three configs and drop the broken tsBuildInfoFile overrides. TypeScript's default places the buildinfo next to the tsconfig (e.g. backend/tsconfig.tsbuildinfo); the root .gitignore already covers *.tsbuildinfo so nothing leaks into git. Local cold-vs-warm tsc --noEmit on the backend dropped from ~3.0s to ~1.4s — ~2x speedup on the warm path. CI builds are still cold because runners do not cache the buildinfo between jobs; that is a separate workflow change. --- backend/tsconfig.json | 3 ++- frontend/tsconfig.app.json | 2 +- frontend/tsconfig.node.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/tsconfig.json b/backend/tsconfig.json index 7a102071..d868830e 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -9,7 +9,8 @@ "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true + "resolveJsonModule": true, + "incremental": true }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] diff --git a/frontend/tsconfig.app.json b/frontend/tsconfig.app.json index 60a86638..043c080d 100644 --- a/frontend/tsconfig.app.json +++ b/frontend/tsconfig.app.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "incremental": true, "target": "ES2022", "useDefineForClassFields": true, "lib": ["ES2022", "DOM", "DOM.Iterable"], diff --git a/frontend/tsconfig.node.json b/frontend/tsconfig.node.json index 8a67f62f..9a176d11 100644 --- a/frontend/tsconfig.node.json +++ b/frontend/tsconfig.node.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "incremental": true, "target": "ES2023", "lib": ["ES2023"], "module": "ESNext",