比create-react-app
更好用的react cli
参考https://github.com/zlab/react-cli-demo
npm i react-cli-service -D
"scripts": {
"serve": "react-cli-service serve",
"build": "react-cli-service build --report"
},
新增react.config.js
默认入口为src/main.js
git clone https://github.com/zlab/react-cli-demo my-project
cd my-project
npm i
or yarn
npm run serve
or yarn serve
npm run build
or yarn build