A basic starter project demonstrating a minimal setup with Webpack 5, React 18, and Babel.
- ⚡️ Webpack 5 with HMR (Hot Module Replacement)
- ⚛️ React 18 with the new createRoot API
- 🎨 CSS support with style-loader and css-loader
- 🔄 Babel transpilation with modern presets
- 🚀 Development server with automatic browser opening
- 📦 Production build optimization
- Node.js (version 14 or higher)
- npm or yarn
- Install dependencies:
npm install
Start the development server:
npm startThis will start the webpack dev server at http://localhost:3000 and automatically open your browser.
Create a production build:
npm run buildThe production files will be generated in the dist/ directory.
├── src/
│ ├── index.js # Application entry point
│ ├── App.jsx # Main React component
│ ├── App.css # Component styles
│ └── index.html # HTML template
├── dist/ # Production build output
├── webpack.config.js # Webpack configuration
├── babel.config.js # Babel configuration
├── package.json # Dependencies and scripts
└── README.md # This file
npm start- Start development server with HMRnpm run dev- Start development server without auto-opening browsernpm run build- Create production build
The webpack configuration includes:
- Entry point:
src/index.js - Output:
dist/bundle.js - Development server on port 3000
- Hot Module Replacement enabled
- CSS loading support
Configured with:
@babel/preset-envfor modern JavaScript@babel/preset-reactwith automatic runtime for JSX
MIT