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
?
Yes. In fact, other than a very small aspect related to enum s, TypeScript doesn't exist at runtime at all. TypeScript compiles to JavaScript, which is a dynamically-typed language.
JavaScript though it is very popular and is the slowest language that takes a lot of time to the execution the commands. Instead, the Typescript is much faster and more efficient as compared to JavaScript both in terms of speed of execution and the scaling of devices as well.
Does TypeScript slow down? Yes, it slows you down because you need to think about your domain and how that maps into types (whether you think those types exist or not, they do).
TypeScript 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).
Either with command line flag --incremental
or in your tsconfig.json
:
{
"compilerOptions": {
"incremental": true
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With