-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation time grows with project size due to type-checking #243
Comments
This comment has been minimized.
This comment has been minimized.
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 |
Can someone add a section of about this to the docs? |
@sebald, it is possible to pass a |
@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! :) |
* add --transpileOnly flag Ref #243 * Document --transpileOnly flag * Make test check that stuff is build * fix anchor id * remove shorthand * remove docs
Current 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 🙂
The text was updated successfully, but these errors were encountered: