Webpack

To bundle client-side code after compiling it with Babel, and also to enable react-hot-loader for faster development, install the following modules:

npm install --save-dev webpack-dev-middleware webpack-hot-middleware file-loadernpm install --save react-hot-loader

Then, to configure Webpack for the frontend development and to build the production bundle, we will add a webpack.config.client.js file and a webpack.config.client.production.js file with the same configuration code described in Chapter 2, Preparing the Development Environment.

Get Full-Stack React Projects 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.