Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Use Vite and don't look back. It's so refreshing compared to Webpack.


You’re missing the entire point. That’s still a build process and still has additional overhead for both development and deployment.


In black and white terms, sure, it’s still a build process, but I second the recommendation to try Vite - the overhead is minimal and the expressive power build chains enable more than justify the overhead. I say this as someone who still writes plenty of vanilla JavaScript and was long reticent to adopt build chains into my workflow.

In this case the A in YAGNI stands for “Are”.


Have you used Vite before? If you have a simple project it's surprisingly fast and painless. What's the "additional overhead" you're talking about? I experienced that with Webpack, but not Vite.

The author even shouts out esbuild as being "a little more stable", which Vite uses under the hood.


I'm definitely a fan of Vite personally. You can tell the project prioritized a focus on developer experience outcomes and its very well executed in my opinion.

But the core package is ~27k SLOC with upwards of 40 dependencies. Thats an indirect, but poignant statement illustrating how much work goes into solving just a tooling problem. And while it may hide some of the overhead in its own abstraction, which it does a fantastic job of, the overhead is still there and it can still break in arcane ways.

I think the spirit of the question of "why do we even need Vite in the first place?" is whats really being explored in the original post.

I certainly don't shy away from build tools at all, but I do often try to start projects without them just as an exercise to see if they really ever end up being needed. Especially when its so easy to drop-in something like Vite after the fact if its necessary and/or clearly adds an outsized return on investment.


I think he just means you have to build before deploying and while developing. Even if that build takes fractions of a second and is trivially scaffolded and automated in a modern context, it’s still technically an extra step. There was a time I might have agreed with that take but I’ve since embraced the build since unless we’re talking about the kind of JavaScript you’d embed in a single blog article and then promptly forget about, chances are you’ll want to introduce build tools eventually.


Vite is so lightweight it feels more like http server than a build system.

The reason why it’s needed at all is it adapts npm packages that are not es modules. It gives you access to all of npm while requiring very little in return.

You can even turn off any transpilation/minification if you want to it to be more 1:1.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: