Live data from Hacker News

Webpack 5

webpack.js.org

71–80 of 182 posts

Re: Webpack 5

#71
post #34

I've been putting off learning Webpack for far too long. Can anyone provide some kind of a syllabus to help me figure out what there is to learn about it, starting from almost no knowledge at all? I feel like it's a critical enough piece of modern web infrastructure that it's worth me taking the time to fully understand how to use it and what it's capable of.

As soon as you veer off the beaten path, which might as well be a tightrope, you need to understand things about webpack that are not made readily available. You need to know what exactly the CSS loader does, what _exactly_ the style loader does, what source queries are, how to _properly_ override import resolutions, and etc.

Getting this information out of the documentation is like squeezing water from a rock. It seems to be written of the opinion that you don't need to know how and what is going on, and if you do you probably already know.

Re: Webpack 5

#73

The past year or so I've moved almost exclusively to backend at work (from Vue frontend) and simultaneously switched to vanilla JS for all new side projects. For those I use native ES modules heavily for internal code, and use very few external dependencies and import them as global scripts like a heretic. Heck I often don't even use npm for node projects anymore. For my latest project I'm even trying to make the ent…

Why not just stick with Vue then? It runs with a script tag and no build step, and works with HTML templates by default.

Re: Webpack 5

#74

We've been using Webpack for a number of years now with our massive webapp. A few months ago we started using esbuild for our development setups. Build times went from ~6 minutes to ~1. This is a sweet spot for us as esbuild is performing really well and made our development much easier. we still rely on webpack for our staging and production builds. The reason for this is esbuild doesn't support a variety of product…

> "uploading bundles to S3"

Why are you using the bundler to do that?

Re: Webpack 5

#75
post #2

"There is a good chance that upgrading fails and you would need to give it a second or 3rd try." Sad that this has almost become the norm when developing in the modern javascript ecosystem. I dread touching those projects and creating one even more because stuff just rots away and your app might break in days, weeks or If you are lucky months. I'm sure there are better developers out there that can handle all of this…

> modern javascript ecosystem. I recently was convinced to start using a packer (webpack, parcel) and was blown away by the hoops people have to jump through to make stuff work. I've been spending an hour or so a day coming up to speed for the past few weeks, and every yarn/npm package I installed had some kind of error/warning that required a hack, or version contortion. I naively thought I could webpack with electr…

To me what’s interesting is that ESBuild (which is a Go based JavaScript bundler) has come out of nowhere in a relatively short period of time, and it’s basically already better than any of the existing JS JS bundlers. Not just faster: it also has a radically simpler UI.

Re: Webpack 5

#76

We've been using Webpack for a number of years now with our massive webapp. A few months ago we started using esbuild for our development setups. Build times went from ~6 minutes to ~1. This is a sweet spot for us as esbuild is performing really well and made our development much easier. we still rely on webpack for our staging and production builds. The reason for this is esbuild doesn't support a variety of product…

ESBuild will transpile to different versions of ES6. It won’t drop down to 5.

I assert that you don’t need 5 support because you aren’t actually QAing IE11 and if you did, you’ll learn that it’s actually been broken and no one reported it.

Re: Webpack 5

#77
post #27
post #15

Earlier quoted context omitted.

Webpack is kind of more "build your own bundler" than a bundler. The configurability and extensibility is immense and with that level of complexity, it's guaranteed things won't work smoothly for everyone (incompatible plugins, unexpected configurations etc.). Anyway, every big project always has hiccups with new major X.0.0 release. Think about your own code for a second. It's typically a well defined code that does…

Run it three times however is not part of such bugginess though. It means that they're randomly encountering different executions/run-states on what should be the same config/setup, each time you run it. And they have no idea why. Or they're running things in parallel, and encountering data races and such, and randomly working as a result. But the real concern is that they don't really know what a correct installatio…

> Run it three times however is not part of such bugginess though. It means that they're randomly encountering different executions/run-states on what should be the same config/setup, each time you run it. And they have no idea why.

Maybe we’ve interpreted that message in different ways, but I took it to mean you may need to try it again at a later date once the community have fixed those issues/bugs. I don’t think they meant literally 3 runs of the same setup.

They’re still working through stuff so there may be edge cases for some where 5 won’t work right now.

Re: Webpack 5

#79
Doesn't work with new JSX transform of react & babel if you have "type": "module" in your package.json

https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-...

https://github.com/webpack/webpack/issues/11467

Seems rules: {test:/\.m?js$/,type:'javascript/auto',resolve:{enforceExtension:false,fullySpecify:false}} fixes

Also nothing in this doc mentions that webpack -p no longer works, instead you need to spell it out webpack --mode=production

Re: Webpack 5

#80
post #2

"There is a good chance that upgrading fails and you would need to give it a second or 3rd try." Sad that this has almost become the norm when developing in the modern javascript ecosystem. I dread touching those projects and creating one even more because stuff just rots away and your app might break in days, weeks or If you are lucky months. I'm sure there are better developers out there that can handle all of this…

> modern javascript ecosystem. I recently was convinced to start using a packer (webpack, parcel) and was blown away by the hoops people have to jump through to make stuff work. I've been spending an hour or so a day coming up to speed for the past few weeks, and every yarn/npm package I installed had some kind of error/warning that required a hack, or version contortion. I naively thought I could webpack with electr…

> Me too! I dread package upgrades because it can instantly turn into an all-hands-on-deck emergency, and these are just the stand-alone packages, not all the ones I mentioned above.

To all package manager developers: make sure you have a rollback function, and make sure it is flawless.

Post reply on HN