4 ms·
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
by SCLeo 4y ago
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.
- shepherdjerred 4y agoVite is just a few lines, and it’s a much better experience than webpack
- SparkyMcUnicorn 4y agoVite 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.
- kitd 4y agoIIRC Vite wraps esbuild, which is written in Go and very fast.
- sebdufbeau 4y agoYou 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.
- dmix 4y agoWebpack 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.
- tpict 4y agoLast 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.