Is Bun Ready for Complex Builds Like Vite? #17170
ravinsharma7
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been exploring Bun as an alternative to Vite, but I have some concerns regarding its capabilities. I’d love to hear from anyone who has experience with Bun for building the frontend for production.
Backend Integration API:
In Vite, I can programmatically load and bundle assets during development via localhost:5173/@Vite, which is useful for non-JS backends like Rails and PHP. As far as I know, Bun doesn’t have a direct equivalent for this. Does Bun provide any way to achieve the same workflow? (or maybe better workflow)
Multi-Build for JS:
With Vite, I can generate multiple JS builds (e.g., ES5 and ES6) in the same build step. I haven't found a straightforward way to do this with Bun. Is there a way to configure Bun’s bundler to handle multiple output targets in one go?
CSS Processing for Web Components:
I need to modify the CSS of web components during the build process—specifically, adding a suffix or prefix for scoping. In Vite, this is possible through plugins and transformers. Can Bun do something similar, or would I need to use an external tool like Lightning CSS?
Module Federation for web components
Module Federation allows JavaScript applications to share and dynamically load remote modules at runtime. I use web components, being able to deploy multiple components or in terms of micro frontends will help me to reduce the size of each component, and micro frontend. Is there anything similar in Bun bundler?
Right now, Bun bundler feels like an "easy to start, hard to finish" kind of tool—super fast, but lacking some key features or plugins. Am I missing something, or is Bun just not quite there yet for complex builds?
Beta Was this translation helpful? Give feedback.
All reactions