Compilation time grows with project size due to type-checking
See original GitHub issueCurrent Behavior
When projects grow, transpilation time of TypeScript tends to grow with it because of the type checking. And while having types is awesome, especially when developing the longer compilation time is meh. Especially because most of the time your editor will tell you anyway that you messed up.
Desired Behavior
Possibility to opt out of type checking.
Suggested Solution
Add option (e.g. --transpileOnly
) to skip type checking all together.
This can be directly passed to the rollup plugin as an option. See docs.
In addition, we could also add a cli command that does only the type checking (e.g. tsdx typecheck
). So people who are opted out, can still easily run diagnostics.
Who does this impact? Who is this for?
Everyone who runs into slow builds.
I tried to switch a project to tsdx and the build time grew to 6min (sometime I even got a heap overflow error from V8 … uuuuups). The project is very small, but the types seems to be very expensive. Removing type checking dropped the build time to 10s.
Describe alternatives you’ve considered
Not using tsdx and configuring rollup ourselves. Noooes!
Additional context
If this proposal sounds good, I am more than happy to work on it 🙂
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top GitHub Comments
i think we’d take a PR for this. good flag to have.
@wessberg Yes, that was my proposal 🙂 I locally tried that and as mentioned it dropped build time to seconds (from minutes).