A robust setup for new React projects
This boilerplate supports by default:
- ES6+, including stage 2 ECMAScript proposals
- Source Maps for easier debugging
- Testing with Jest and Enzyme
- Hot Module Replacement (HMR)
- Code splitting
- Scoped CSS classes with CSS modules
- Compression and caching for production
- PWA-ready build
- IE9 / Safari 10 (for React 16)
- Clone the repo:
git clone https://github.com/diego-c/react-webpack-starter.git
- Move to the project's directory:
cd react-webpack-starter
- Install packages:
npm install
oryarn install
- Start the server:
npm start
oryarn start
To run all tests:
npm test
or yarn test
NOTE: if you wish to use async/await for your tests, install the regenerator-runtime
package and add on the top of your file:
import 'babel-polyfill';
import 'regenerator-runtime';
See this StackOverflow thread for more info.
To build your project:
npm run build
or yarn build
Your assets will be available in the dist
folder