项目作者: Shiva1029

项目描述 :
Reactjs16+Redux+jest
高级语言: JavaScript
项目地址: git://github.com/Shiva1029/react-demo.git
创建时间: 2018-05-22T03:03:29Z
项目社区:https://github.com/Shiva1029/react-demo

开源协议:MIT License

下载


Using

  • React 16
  • Webpack 3
  • React Router 4
  • SASS
  • Babel Cli
  • Hot Module Reloading
  • Jest 22
  • Enzyme 3 for testing

To run

Make sure you have git, node and npm installed globally and accessible through the command line.

  • Clone
  1. git clone https://github.com/Shiva1029/react-demo.git
  2. cd react-demo
  • Then install the dependencies:
  1. npm i
  • Run development server:
  1. npm start
  1. npm run dev

Open the web browser to http://localhost:8888/

To login

email

  1. test@test.com

password

  1. demo

To test

To run unit tests:

  1. npm test

Tests come bundled with:

  • Jest
  • Enzyme
  • React Test Utils
  • React Test Renderer

To build the production package

  1. npm run build

Running build locally

  1. npm run serve:build

Open the web browser to http://localhost:8080/

Eslint

There is a .eslint.rc config for eslint ready with React plugin.

To run linting, run:

  1. npm run lint

To fix

  1. npm run lint:fix

Nginx Config

Here is an example Nginx config:

  1. server {
  2. # ... root and other options
  3. gzip on;
  4. gzip_http_version 1.1;
  5. gzip_types text/plain text/css text/xml application/javascript image/svg+xml;
  6. location / {
  7. try_files $uri $uri/ /index.html;
  8. }
  9. location ~ \.html?$ {
  10. expires 1d;
  11. }
  12. location ~ \.(svg|ttf|js|css|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {
  13. access_log off;
  14. log_not_found off;
  15. expires max;
  16. }
  17. }

Github Page

  • Works on latest versions of IE, Edge, Chrome, Firefox and Safari.