/React-SPA-Tutorial

A SPA with React、React-router、webpack、Fetch、ES6、babel、iconfont微信移动端端单页应用(spa)

Primary LanguageCSS

Example React-Babel-Webpack

image

Features

  • 自主配置的开发环境

  • 采用ES6语法,组件化、模块化开发

  • 前端控制路由

  • Scss代替css

  • 自动打开、刷新浏览器

  • Equip with React, ES6 & Babel 6

  • Lint with JSHint.

  • Build with Webpack

  • Support hot module replacement

  • Auto Open a new browser tab when Webpack loads, and reload the page when you modified the code

  • Use Commitizen to produce commit message according to AngularJS convention

  • Use conventional-changelog to generate CHANGELOG.md

How to use

First, you should clone the repo and install the dependencies.

$ git clone https://github.com/allan2coder/React-SPA-Tutorial.git <yourAppName>
$ cd <yourAppName>
$ npm install

Then, launch the project app.

$ npm start

You should see a new browser tap opening and a page of "index.html" in http://127.0.0.1:8080.

From there, you start to develop your own code in the app directory. When you finish coding, use npm run build or npm run deploy to build the static files.

Formatted commit message

When committing your code, you can use AngularJS's commit message convention. If you use npm run commit or git cz instead of git commit, the command will help you to produce a formatted commit message.

JSHint

$ jshint myfile.js
myfile.js: line 10, col 39, Octal literals are not allowed in strict mode.

1 error

FAQ

Checking the node version, when you have a problem with running npm start. And updata your node to high version.

有没有人捐助让我感受下世界的美好 (;′⌒`)

向已经捐过钱大佬表示感谢

image

Reference Articles

License

MIT

React-SPA-weixin