Tired of complicated starters with 200MB of dependencies which are hard to understand and modify? This is for you!
- NPM 8
- Webpack 3
- React 16
- Hot Module Reloading
- React Router 4
- Babel CLI
- Jest 22
- Enzyme 3
- Simple src/index.jsx.
- Webpack configuration for development (with hot reloading) and production (with minification).
- React Hot Loader for live reloading without the loss of state during development.
- Webpack Dashboard Plugin on dev server.
git clone https://github.com/ReactJSResources/react-webpack-babel.git
- Then install the dependencies:
yarn install
- Run development server:
yarn start
- Or you can run development server with webpack-dashboard:
yarn dev
Open the web browser to http://localhost:8888/
To run unit tests:
yarn test
Tests come bundled with:
- Jest
- Enzyme
- React Test Utils
- React Test Renderer
yarn build
If you are using Mac/Linux simply run the following command inside public directory:
python -m SimpleHTTPServer 8000
Here is an example Nginx config:
server {
# ... root and other options
gzip on;
gzip_http_version 1.1;
gzip_types text/plain text/css text/xml application/javascript image/svg+xml;
location / {
try_files $uri $uri/ /index.html;
}
location ~ \.html?$ {
expires 1d;
}
location ~ \.(svg|ttf|js|css|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {
access_log off;
log_not_found off;
expires max;
}
}
There is a .eslintrc
config for eslint ready with React plugin.
To run linting, run:
yarn lint
There is a .prettierrc
configuration for Prettier.
To prettify code, run:
yarn prettify
To test prettier before changing any files, run:
yarn prettify-test
Please contribute to the project if you know how to make it better, including this README :)