Webpack configuration for Reactjs
A boiler plate for creating react applications bundled by webpack (using ES6+, Babel, SASS and webpack development server)
- React 16
- Webpack 4
- Babel 7
- Hot Module Replacement
- File bundling with webpack
- Webpack configuration for development (with hot reloading) and production (with minification).
- CSS module loading, so you can include your css by
import styles from './path/to.css';. - Both js(x) and css hot loaded during development.
- Clone this project to any folder on your local machine
git clone https://github.com/behnamshateri/webpack-setup-for-react.git <FOLDER_NAME_HERE>- Navigate into the folder name specified
cd <FOLDER_NAME_HERE> yarn buildor
npm run buildRun npm start to intialize and run the webpack development server. Navigate to http://localhost:8081/. The app will automatically reload if you change any of the source files.
To run the app in production build of the app, use either of the following.
yarn buildor
npm build