Install webpack in react Application || install babel
Run this commands form terminal or cmd npm init npm i webpack --save-dev npm i webpack-cli --save-dev npm install -D babel-loader @babel/core @babel/preset-env webpack npm i @babel/preset-react --save-dev npm i babel-core --save-dev npm i babel-preset-env --save-dev npm i babel-preset-es2015 babel-preset-react babel-preset-stage-0 --save-dev npm i react react-dom --save-dev npm install webpack-dev-server -g // In window and mac os this command will not work then use this npm i webpack-dev-server --save-dev Create a new file named Webpack.config.js into root directory copy and paste this code into webpack.config.js file var path = require('path'); module.exports = { entry: './src/main.js', // Bundle all assets from this location together output: { filename: 'index.js', // Output to this file path: path.resolve( __dirname, 'public' ), // In this location }, module: { rules: [