Use Sucrase for faster builds
See original GitHub issueClear and concise description of the problem
I’ve been using Vite for about 2 months now and I must say I’m in love with it.
I’m also developing mobile apps using React Native and Expo, and after upgrading Expo to SDK to its latest version I realized my building time has dropped from ~1:43 to just ~1:00 on a mid-size app (apart from reducing the app size from 92 to 74MB).
There’s no right or wrong here, but I believe it could be an improvement for faster builds at least during development by using sucrase instead of TS as a compiler.
More on how/why Expo uses Sucrase for building here.
Suggested solution
Create an experiment by using sucrase for compilation of node_modules
with @rollup/plugin-sucrase and benchmarking it to see results for both build time* and potentially bundle size** on different projects of mid and large sizes.
Note: I’ll start experimentations using Sucrase instead only for node_modules
and see not only if it reduces the building time, but also guarantee that nothing will be broken.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that request the same feature to avoid creating a duplicate.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Sucrase seems to be partially forked from babel, and the closest rust-alternative to babel is swc. swc has been brought up from time to time to replace some of the babel usage of vite plugins as well. Maybe one day VIte would use it as well.
I’ll close this for now since it seems unlikely that this would happen soon. But feel free to experiment it with Vite if you wish.
yes i think so (about is not a perfect fit for vite), sucrase has a lot of limitations esbuild is likely more future proof, i just point out sucrase it’s faster (since split transpilation work across threads is so trivial even if sucrase is single-threaded)
i’m so curious about how faster sucrase could be if is build using a compiled language as rust 🤔