Making an asset manifest

As the last step, we want a list of all the static assets that we’re generating. This will be useful down the line, once we start caching them to save load times. Fortunately, it’s an easy step, another plugin!

yarn add webpack-manifest-plugin and add it to webpack.config.prod.js, under plugins, with the following configuration:

var ManifestPlugin = require('webpack-manifest-plugin');// Then, under plugins:new ManifestPlugin({  fileName: 'asset-manifest.json',}),

Okay, let’s try it all together. Run yarn build and then open index.html in the browser. It should look exactly the same as running yarn start. You should also see an index.html, a bundle.js, an asset-manifest.json, and an assets folder in our build folder. ...

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.