In this recipe, we are going to implement React with Webpack 4, but we will use a plugin called html-webpack-plugin to generate our index.html file to render our React application. In the next recipe, we will integrate Node.js to have more flexibility in our server-side before rendering the HTML code.
Adding React to Webpack 4
Getting Ready
For this recipe, you will need to install the following packages:
npm install react react-dom babel-preset-react
How to do it...
Here are the steps to add React to Webpack 4:
- Using the same code of the last recipe, create a .babelrc...