News for hackers. Stuff that matters.
Re:Vite – Next Generation Front End Tooling by SCLeo on Sunday July 03, 2022 @12:54PM (#31969097)
I have been using parcel for web development because I thought webpack is very difficult to use. However, for my latest personal project, I tried webpack. To my surprise, I found webpack 5 much simpler to use then I thought it is (significantly easier than make or gradle, the complexity is not even on the same level). Everything pretty much worked out of box now. All I had to do was to copy the starting template for typescript from their website (~20 lines, half of which are open/closing brackets) and copy the setup for dev server. HMR, code splitting via dynamic imports, etc. all worked without any setup.
Re:Vite – Next Generation Front End Tooling by dmix on Sunday July 03, 2022 @02:25PM (#31969834)
Webpack is probably fine for new or small projects. It's when you've been using it for a while, do anything complex, or worst of all your framework libraries update then you have to update Webpack which is a nightmare.

Ive had Webpack break more of my deploys than any other piece of software in the last 3 years.

Vite was basically a plug and play replacement (almost zero config) and I also got to drop Babel, so that meant replacing about 12 packages in my package.json and who knows how many in Yarn.lock (Mostly babel and webpack plugins) with 2 vite packages. It's much faster at builds and the chunking of small js files seemed more intelligent and better integrated with Vue.

Re:Vite – Next Generation Front End Tooling by SparkyMcUnicorn on Sunday July 03, 2022 @02:17PM (#31969771)
Vite is incredibly fast compared to Webpack.

I didn't really know how much time I could have been saving, and I never even thought of Webpack as slow.

Re:Vite – Next Generation Front End Tooling by kitd on Monday July 04, 2022 @01:52AM (#31973856)
IIRC Vite wraps esbuild, which is written in Go and very fast.
Re:Vite – Next Generation Front End Tooling by sebdufbeau on Monday July 04, 2022 @10:06AM (#31977171)
You can use esbuild with webpack via esbuild-loader, but what makes Vite so fast is mainly the strategy of pre-bundling dependencies when running the dev server, this makes hot starts and hot reloads incredibly quick.
Re:Vite – Next Generation Front End Tooling by shepherdjerred on Sunday July 03, 2022 @01:39PM (#31969440)
Vite is just a few lines, and it’s a much better experience than webpack
Re:Vite – Next Generation Front End Tooling by tpict on Sunday July 03, 2022 @04:29PM (#31970739)
Last time I checked NPM the weekly downloads were still heavily slanted in favour of version 4. I wonder if that plays into perception of it.

At work, an engineer in a different team recently recommended we switch to Vite because it’s “so much faster”. Warm builds are 700ms with our very uninteresting Webpack 5 config. It’s hard to imagine that the cost of reconfiguring our entire build would be worth it.