webpack-boilerplate-react
After using the Parcel bundler for nearly every project I decided to give webpack a try. This is a boilerplate supporting all the coolest functionalities of Webpack 4 shown in its documentation as well as React + Redux + Jest + PWA support.
Usage:
Download or clone this repository so you can run the following commands:
npm install
npm run dev
- starts a dev server on localhost:1234
npm run build
- builds and optimized bundle
npm run serve
- serves ./dist on your local network
npm run test
- runs Jest for testing
npm run testwatch
- like above but in watch mode
The features include:
- Pretty much all the cool stuff Webpack 4 can do as shown in its documentation
- Generating service workers to cache website assets and enable PWA support
- Ready out of the box project files using React + styled-components + Redux to quickly get you started
- Dev-server with HMR
- Code splitting with import()
- Turning smaller images into Base64 strings
- Configured Jest with Enzyme for testing (the demo one tests a React component)
- Cool bundle analyzer
- PostCSS and Babel to minify and transpile all your JS and CSS fiiles and allow you to use the latest features.
- Useful libraries such as lodash and superagent listed in package.json
Is there something wrong?
Please tell me!