react cli service
比create-react-app
更好用的react cli
structs
参考https://github.com/zlab/react-cli-demo
已有项目
npm i react-cli-service -D
package.json
"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
install
npm i
or yarn
dev
npm run serve
or yarn serve
preview
build
npm run build
or yarn build