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

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.



This pretty much nails the problem with Webpack in my view. It doesn't seem to be based on any kind of strong, logical, easy to understand core, but instead is comprised of lots of interwoven threads of magic that no-one really understands.

This makes any attempt to debug and solve problems with it a total nightmare, like crawling through a tar pit. You might make it, but you're gonna feel all sticky and dirty coming out the other side.

That said, kudos to the developers, I use it every day, but I wish it were a lot simpler.


For me, I need webpack to make packs of "configuration set" that's easy to use. Let's say that one of them is react jsx to js "set", bundled with css, style, file and url loader. So for those who want to start with webpack and typescript react, they only need to use that "set", and define only the input/output.


So, a complicated Makefile?


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.


Honestly, if your day job hasn't forced you into using a bundler, I'd recommend avoiding it if you can. For modularity, I start with native ES modules. If things got complicated enough that I thought a bundler would offer me some sort of a benefit, I'd reach for rollup first.



Thanks, that book likes exactly what I need. Bought it on Kindle.


> I've been putting off learning Webpack for far too long.

I don't think most people really "learn" Webpack. Mostly they just tweak cut+paste examples and get back to value add work. You can definitely achieve 99% of whatever task you have without going down the warren of Webpack rabbit holes. You're committing no crime if you just relegate Webpack to the "get it working and forget it" bin; it does what it says on the tin and you can rely on it despite not being an expert.


Nah.

EDIT: ok, some more context. You should be glad you haven’t had to deal with this shit show yet. Don’t walk willingly into it, there are much less painful tools like Rollup, Vite and Parcel around.




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

Search: