3 ms·
Cool! Why do you need both Bun and Vite?
by erikpukinskis 1y ago
Cool!
Why do you need both Bun and Vite?
- deleted 1y ago[deleted]
- Etheryte 1y agoBun is a runtime, Vite is a build tool. You can mentally swap them out for Node and Webpack to answer your question.
- davidmurdoch 1y agoIsn't Bun also a build tool?
- _heimdall 1y agoYeah bun has a build command and handles at least most of what vite does (bundling, code splitting, asset imports, etc). I'm also curious why you'd need vite with bun, maybe there are some features in vite that bun is missing?
- sroussey 1y agoBun is working to be a Vite replacement for many use cases, but that aspect is under heavy development right now. If “bun index.html” works for you right now, then great! Otherwise you may need to go to vite for a while yet.
- ToJans 1y agoWe're currently in a rewrite with the exact stack this starter pack has. Bun is faster & has better package management, but the build is only suitable for very basic use cases. Once you get into more exotic build scenarios, the lack of plugins for bun gets obvious, so we've switched from a custom bun build script back to vite. Side note (in true HN tradition): I'm a bit hesitant to base our front-end on react. It has currently become the de-facto ui solation, which makes me wonder if the new kid on the block (solidjs IMHO) would not be more suitable. Unfortunately the ecosystem for solidjs isn't at that level where I'm confident enough yet to make the big bet & switch to it in full. Maybe we'll use it in a few side/tool projects, too get a general feel and see how this evolves...
- stevedsimkins 1y agoThanks!! Vite is specifically used for bundling the frontend and chosen due to the vast ecosystem of plugins that people use for it. Tailwindcss is a great example, others here: https://vite.dev/plugins/ https://vite.dev/plugins/ Bun does quite a bit more. In this context it’s used as a runtime and a package manager, and automatically handles the workspaces aspect for shared types. While you might be able to achieve all of bhvr with just Bun I chose to stick with Vite due to the number plugins, tutorials, setups, etc. that all use it. Just keeps things simple and easy!
- timeon 1y agoJS/TS stack still seems bit complicated.