"SurviveJS - Webpack" Updated to webpack 4

Quite a bit has happened in the world of webpack. Most notably, the webpack reached version 4 recently. The purpose of this release of the book is to update it to support webpack 4 while preparing towards the next paper edition.

Compared to the previous release this one is even lighter although it's more informative at places. Webpack became simpler and this meant the book could as well. Most notably CommonsChunkPlugin is gone now and the tool comes with better defaults.

If you aren't interested in what has changed, skip straight to the book.

Overview of the Situation#

Somehow the December and the early part of the year just went by. Organizing React Finland took its toll and it's still an ongoing effort. On the plus side, doing this has taught me a lot so far.

I've also begun to generate some business in Vienna although it hasn't been particularly easy. There's likely more to come and these things tend to get easier over time.

After webpack 4 came out, I updated the book to it fairly quickly. I gave it some extra polish and now it's the time to release the improvements to the wider public. There's still some work left to be done and I can cover topics such as WebAssembly in future versions but overall it feels like the best version yet.

Book Improvements - 2.3#

I released a series of silent releases as before. The chapter structure is intact but the contents have changed significantly at places as webpack 4 allowed simplifications. The grammar has been improved as well.

I've listed the main changes next:

  • Eliminating Unused CSS chapter is before Autoprefixing now as this way it felt like it flows better.
  • The Comparison of Build Tools appendix has been largely rewritten to reflect the current situation.
  • The Source Maps chapter has been tuned to take webpack 4 into account leading to simplifications.
  • The Bundle Splitting chapter has been rewritten to take advantage of webpack 4 syntax. Much simpler now.
  • The Code Splitting chapter doesn't contain the old syntax anymore. It's better to refer to webpack documentation for that.
  • The Getting Started chapter has been rewritten so it's easier for people to go through.
  • The Loader Definitions chapter has been expanded to contain more ideas.
  • The Loading Fonts chapter doesn't contain Font Awesome example anymore. Their documentation seems to cover usage well enough now. The change also simplified the remaining book.
  • webpack.NamedModulesPlugin gets less attention now that webpack has mode and module ids are set in a better way without the user having to tune them.
  • The Build Analysis chapter has been expanded to contain more ideas.

In total 242 commits went to the book since the last public release. You can find the changes at GitHub. Remember especially the "Files changed" tab as it gives you a good overview of what's happening with the book.

You can find the book below:

A part of the income (around ~30%) goes to Tobias Koppers, the author of webpack. I support his work this way given mine builds on top of his. Literally, most of the income goes to webpack developers now!

What Next?#

Even though I have a list of improvements planned for the webpack book, it doesn't make sense to push it to paper until mini-css-extract-plugin and Babel 7 have reached stable status. mini-css-extract-plugin replaces extract-text-webpack-plugin for majority of users but it still requires more work. It will simplify CSS configuration somewhat.

Most likely the next book release has to do with the maintenance book. There are those last bits of content that require work and the book needs structural editing as well. That said, it's already a useful one even its current state.

Conclusion#

I hope you enjoy the webpack 4 version of the book!

Note that I'm active at the book Gitter channel if you want to bug me about webpack. You can also ask questions at my AmA.

There will be webpack workshops in Munich early May 2018!
Need help?