一个记录每天健康指数的单页应用,利用localStorage进行本地存储,使用最新的react技术栈开发。
This project was bootstrapped with Create React App.
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
npm run build
first, then run analyze to analyze the bundles.
- React
- Create-react-app
- Echarts-for-react
- antd
- moment
- clipboard
- customize-cra
- less
- create-react-app 没有 eject
- 主要通过 customize-cra 修改 cra 的默认配置
- antd 的日期选择组件,需要传入 moment 对象,所以又 TM 引入了 moment.js
- 修改了配置变量,生产环境下 不生成 sourcemap 文件
- 在 package.json 文件中,配置了 homepage 字段,用来修改编译后的静态文件路径
- 引入了 source-map-explorer 支持分析打包后的文件大小,需要去 config-overrides 文件中,将 GENERATE_SOURCEMAP 置为 true
- echarts-for-react 使用了按需引入的写法