5 ms·
If Bun is able to run and bundle a TypeScript React app out-of-the-box, what are the benefits of using Vite.js on top of it? I'm confused cause this guide on t
by ggregoire 3y ago
If Bun is able to run and bundle a TypeScript React app out-of-the-box, what are the benefits of using Vite.js on top of it?
I'm confused cause this guide on the official site showcases how to use Bun + Vite.js to build a TypeScript React app. [1]
There is also this issue on their Github. [2]
Can Vite.js be used to handle more complicated scenarios / advanced use cases that Bun doesn't handle? My use of Vite.js is pretty basic (start & build with the default TS+React config) so maybe I'm missing something here.
--
[1] https://bun.sh/guides/ecosystem/vite https://bun.sh/guides/ecosystem/vite
[2] https://github.com/oven-sh/bun/issues/250 https://github.com/oven-sh/bun/issues/250
- fyzix 3y agoMy guess is that you can leverage the vite's plugin ecosystem...postcss,tailwind,terser etc. And most of the new meta frameworks(nuxt,sveltekit,astro,solidstart,qwik) runs on vite so that might pave a path for adoption.
- nsonha 3y agothat's like asking why need vite when you have tsc. I assume bun does not "run Typescript React app", it only does the jsx,tsx transpiling out of the box.
- brundolf 3y agoIt's a big ask to get people to adopt an ecosystem wholesale. Compatibility with the existing ecosystem is a key goal of Bun, so that people can start using it immediately on their existing codebases and then adopt it gradually for more and more stuff
- jadbox 3y agoI'm new around here, I've only seen people use Vite with bun for HMR, but imho, it's not great to combine them just yet as there's config complexity.
- ggregoire 3y agoI thought Bun had HRM out-of-the-box but it's not working? Not sure. https://github.com/oven-sh/bun/issues/833 https://github.com/oven-sh/bun/issues/833
- jaktet 3y agoVite still leverages node, esbuild, swc, tsc, etc for parts it’s not directly responsible for. Granted I have no experience with bun yet, my take on it is that you can leverage bun for running the local dev server (instead of node), leverage bun for bundling (instead of esbuild or tsc or rollup or an amalgamation of them), and leverage bun for transpiring instead of Babel and typescript. What vite provides is an easy to configure setup for developing frontend applications with a nice DevX when working locally.