DEV Community

Cole Diffin
Cole Diffin

Posted on

YAWS

EDIT: The description dosn't show in the Full View, so the title doesn't make much sense... "Yet Another Webpack Story"

I bet you are here thinking I'm going to tell you how awesome Webpack is. Sorry, you may wish to take this opportunity to find something else to read. Don't worry about it. I won't mind if you don't continue reading my opinion piece. Seriously. It's Ok...

Webpack. It's great right? does everything. It 'Just Works(TM)'?

I've always felt a certain dislike for Webpack - without every truly being able to explain it. I've (finally - after years of avoiding it) used Webpack a couple of times recently and still and not sold on it's "awesomeness".

To start with, Webpack 2 had come out about 2 weeks before I picked it up for the first time. I was aware of this, and figured there would be minor inconsistencies from 1, and that most things would still 'Just work(TM)'. No. Just No. After spending way too long, I discovered that pretty much every plugin created on the internet was now incompatible, and all the tutorials on getting started were out of date. Sometime later, I had a working instance of Webpack 2 with enough plugins and understanding I felt like next time would be better.

Next Time, was not better. I happened to start a spike project with Webpack, and found out that Webpack 3 was now available. I figure why not, surely they learned from there mistakes the first time. And made it an easier transition. No. After spending far longer than I care to admit, I reverted to my previous Webpack 2 config and gave up on 3.

I've had a couple of other dealings with Webpack in various scenarios, but nothing to write home about. It was always on my mind that people rave about Webpack, and I constantly hear how awesome it is. I've kept an open mind on things, but I've never seen nice clear instructions on how to do anything more than basic bundling. (Yes, I know you can do many things with Webpoack, but it ends up a convoluted mess)

Until Today.

I came across some really neat examples of code-splitting and lazy loading, in the Webpack docs of all places. I was pretty amazed - Could Webpack finally be on a winning streak.

I haven't mentioned until now that both at work and personally, I've been using Browserify quite heavily, combined with other tools to achieve the same results as Webpack. I've been open to switching, but as per experiences, have not really seen the benefit of doing so.

After discovering Webpack's code splitting and other fun features, I did a quick search to see how/if Browserify supported anything similar, and came across this: https://gist.github.com/substack/68f8d502be42d5cd4942 a very detailed breakdown and comparison of many Webpack features, and code snippets and more. Reading through that article, my daily wtf/wow rate went up by quite a number. I had no idea that Browserify did all that. I've only been using the basics, and performing some of the more complex actions via other tools, or custom rolled scripts.

I now understand a lot better about why I dislike Webpack, and I'm happy to continue doing so for the perceivable future. But for the present, time to start exploring the Browserify ecosystem again, and see what other advancements have happened in the last couple of years I may be missing out on.

Top comments (0)