4 ms·
I'm a happy vite user, but it troubles me when I think about how complicated everything it abstracts has become. It uses rollup for some things, esbuild for ot
by candiddevmike 4y ago
I'm a happy vite user, but it troubles me when I think about how complicated everything it abstracts has become. It uses rollup for some things, esbuild for others, workbox for my service worker... I switched from webpack to it, and while my config is certainly less complex, I at least could tell you what webpack is doing. Vite is magic.
Can I just use esbuild yet?
- sampullman 4y agoI think Vite is waiting for code splitting and plugin support in esbuild. It does seem like magic sometimes, but the the code is relatively straightforward. It's not too complicated to dig into to the internals if you're curious about how specific configuration works under the hood. With Webpack I never really felt that way, but maybe it's some kind of subconscious bias from struggling so often with massive configs.
- candiddevmike 4y agoCode splitting issue: https://github.com/evanw/esbuild/issues/16 https://github.com/evanw/esbuild/issues/16
- Rapzid 4y agoHard to get a feel for if that will ever land.
- aidos 4y agoThing is, I did dig into the webpack code after having the watcher not reloading with code changes. I can’t recall the details but there were several different packages that were thin wrappers around each other and ultimately inotify (or something at the bottom). One of those wrappers was silently hiding the error about not having enough watcher available at the file system level. I was not impressed with what I found.
- christophilus 4y agoI just use esbuild. If your use case is simple enough, it’s totally fine.
- qbasic_forever 4y agoYou can totally just use esbuild, it is extremely well documented and easy to grok. It's very easy to embed in a go app too, but you don't have to do that or be a go programmer to use it (they put it on NPM and gave it a super basic CLI). The docs are great: https://esbuild.github.io/getting-started/ https://esbuild.github.io/getting-started/ If you're just bundling JS, transforming typescript, maybe doing JSX, etc. then it's just a simple esbuild CLI command to do it. Toss it in a makefile or your CI tooling and you're done.
- exhaze 4y agoI agree with your sentiment. It's magic until it isn't. When something breaks, you need to often need to dig into the implementation and understand how everything works. This becomes harder and harder when there are more and more layers of code and libraries, many written by completely different people. Seems like frontend is still going in this direction of "magic > simple". I wonder when we'll reach some point where we see a dramatic shift.
- rglover 4y ago> Can I just use esbuild yet? Yes. esbuild works great. I use it in my own full-stack framework [1]. Builds take < 1s, even for big projects. It's a really impressive tool. [1] https://github.com/cheatcode/joystick https://github.com/cheatcode/joystick
- FlorianRappl 4y agoYes you can. Code splitting will potentially not land in near future, but of already there if you output esm - which you can then (if wanted) convert with a simpler tooling (e.g. Babel or swc) to another format of you want. We switched to es build a year ago and never looked back.
- aliswe 4y agoI am under the impression that vite uses esbuild and roll up?