The github repo, react-webpack, has the minimal scaffolding for a React web app with Webpack 4. The tutorial explains how the project was built.

New project

Create a new project

yarn init

Install Webpack as devDependency.

yarn add webpack webpack-cli webpack-dev-server --dev

Create Webpack configuration file:

const path = require('path'); 
module.exports = {     
  entry: './src/index.js',     
  output: {         
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js',
Read More