Building for production

So far, we’ve been entirely focused on using Webpack in a development context, but we also need to think about deploying our app to production, and what that may involve.

When we send our app out to the World Wide Web, we don’t want to send anything unnecessary (remember that our goal is performance); we want to deploy the bare minimum.

Here’s what we need:

  • An index.html page (minified)
  • A CSS file (minified)
  • A JavaScript file (minified)
  • All image assets
  • An asset manifest (a list of the preceding static files)

We have some of these, but not all. Let’s work on using Webpack to automatically generate a build folder with all of these, which we can deploy later.

First, a minified index.html. We want Webpack to take our ...

Get Progressive Web Apps with React now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.