#421

Webpack on my blog

Last night I sat down and finally fixed my blog. Since Google App Engine removed Golang support from the gcloud binary (their tool for deploying code and interacting with Google Cloud properties from the command line), I haven't been able to deploy updates to my blog. I also haven't been happy with how the app is structured, nor how assets were managed.

So last night I fixed all of the things. I downloaded the Google App Engine Golang SDK, changed my Makefile to actually use it, fixed broken code in the links page (you'll notice it now actually shows things in order), and switched the asset pipeline from gulp to webpack.

Webpack, at a very high level, is a tool that evaluates Javascript written in a certain way (basically like Node or React) and creates an output file that contains everything you need. It combines CSS, Javascript and images into a single downloadable file that you can distribute.

site

In fact if you inspect my site now, there are only really three assets that download when you visit my site: The HTML itself, a file called bundle.js, and the image at the top of the page.

bundle.js contains everything my site needs to run:

I had to hack embedly's code to work (as I imagine I would for any jQuery plugin), but everything else I was able to just drop in.

I wanted to put images in the bundle too, but I couldn't get it to work without rewriting my entire frontend in something like React, which I'm just not quite ready to do yet.

I like the basics of webpack. Seems like a cool idea. But it is not there yet. Documentation is horrible. People outside of the React community don't seem to be using it, and some of the error reporting is pretty confusing. I really like the idea though, and I'm looking forward to see how it progresses.

/Nat