3 ms·
So far what I've been doing is keeping my webpack config as simple as possible (< 40 lines) and just relying on default behavior. I know I'm losing out by not b
by sinker 6y ago
So far what I've been doing is keeping my webpack config as simple as possible (< 40 lines) and just relying on default behavior. I know I'm losing out by not bothering with some of the more intricate configuration properties like caching, etc.
But one of my big pet peeves is when you clone a project and the installation says all you need to do is run make install or npm i, but in reality requires 20 google searches and an hour of banging your head to get the project running and even then you end up with 50 cryptic warning messages in your terminal so you don't even know if you did it correctly.
With a very simple webpack config you might lose out on optimizations but at least you can get just about anyone running a project locally and if things go awry you can generally pinpoint the problem to a specific line of configuration.
- nicoburns 6y agoI've found that a slightly longer (~100 lines) webpack config allows me to use all the caching and fancy tricks I want and is still just as debuggable. I think the main thing is setting it up yourself so you know what all the plugins/settings do.
- nwienert 6y agoThe key is don’t abstract it. No function builders, one big object with inline conditional spreads.
- zamber 6y agoCaching was a major dissapointment for me. DllPlugin is a nightmare to setup and other caching plugins I tried don't really speed things up. What eventually worked for me is HardSourceWebpackPlugin [1] - two lines added and went from 2min to 15s (with a tradeoff of a slightly longer initial build). [1] - https://github.com/mzgoddard/hard-source-webpack-plugin https://github.com/mzgoddard/hard-source-webpack-plugin
- nicoburns 6y agoNot sure on the specifics, but my understanding is that the major improvements in Webpack 5 are related to caching.
- zamber 6y agoI got the same message. Still, having faster builds with one additional plugin without configuration needs on projects locked on 4 or waiting out the transition is a plus in my book :).
- gremlinsinc 6y agoI just use laravel mix, as a wrapper around webpack, and then I can extend that if I need to for certain things, like maybe aliases, or something.
- nickthemagicman 6y agoWhy not just use npm at that point?