Hacker News new | ask | show | jobs
by marcus_holmes 2521 days ago
It's taken me 8 days to answer, because I've rewritten this a few times. I may write this up as a blog post.

OK, so...

    1. It doesn't do one job and do it well. It tries to do it all.
    2. It has magic. Why does this setting do this? Don't know, just do it.
    3. It's vastly overcomplicated (related to 1, and produces 2)
    4. It's a black box. It's not at all transparent about how it does what it does, and the output it produces seems to be arbitrary. I mean, you could probably work back from the minimised mess that you get to relate it to the source, probably. But it's not at all clear why tweaking this declaration makes that function move to that module.
    5. It's not instrumented, or predictable. Changing a declaration can make it double its processing time, and there's no way of knowing which of the 5 changes you just made caused that.
And finally... It's a solution to a problem that only exists because of the dependency culture in the JS community. Because each dependency contains a lot more code than is needed to solve the one problem it was imported to solve, web apps tend to bloat. So we need to break them into modules and only import the modules we need. So we need a tool to do that and package the modules up. So we get Webpack. Instead, why don't we just import less code in the first place? We really (and I mean really) don't need 500Kb of javascript to create a basic web app. If we could cut that down to 100Kb then we could just minimise it and we wouldn't need webpack at all (maybe Gulp to run Babel for those oh-so-necessary new cool JS features).