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.
Possibility to opt out of type checking.
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.
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.
Not using tsdx and configuring rollup ourselves. Noooes!
If this proposal sounds good, I am more than happy to work on it 馃檪
can also explore using the --incremental flag
IIRC create react app solved this issue by using the webpack plugin fork-ts-checker so that the bundle would still be emitted quickly and type checking would happen asynchronously sometime afterward
@sw-yx do you mean the flag from the TS compiler? That is what we are using before. But the CI is running for 6mins, if no heap overflow happens. Because there is no cache.
@audiolion yes! That's kind of what I am suggesting here :) Checking out https://github.com/wessberg/rollup-plugin-ts/, there seems to be no option to do this right now. Which is fine, since --noEmit does the trick as well.
Can someone add a section of about this to the docs?
@sebald, it is possible to pass a transpileOnly option to rollup-plugin-ts which may help you here.
@wessberg Yes, that was my proposal 馃檪 I locally tried that and as mentioned it dropped build time to seconds (from minutes).
i think we'd take a PR for this. good flag to have.
Working on it! :)