I have a fairly big TypeScript project (200+ files) and it takes some time (10s+) to boot up when I run it in watch mode (tsc --watch
). However once its going it is pretty fast to do a full typecheck TypeScript.
How can I speed up the initial boot of tsc --watch
?
I have a fairly big TypeScript project (200+ files) and it takes some time (10s+) to boot up when I run it in watch mode (tsc --watch
). However once its going it is pretty fast to do a full typecheck TypeScript.
How can I speed up the initial boot of tsc --watch
?
1 Answer
Reset to default 19TypeScript 3.4 rc got the --incremental
compiler option (blog post).
When it is enabled TypeScript will generate a .tsbuildinfo
file if there isn't one already (so you still play the 10s+ penalty once). But if it exists, a cold tsc --watch
run will be super fast (no longer 10s delay).
How to enable incremental builds
Either with command line flag --incremental
or in your tsconfig.json
:
{
"compilerOptions": {
"incremental": true
}
}