1.0.0 • Published 3 years ago

fs-template-test v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

template

开发

  • 安装所有依赖:npm install
  • 启动项目:npm run dev
  • 打包:npm run build:prod/dev

目录结构

  • _JsonMock_Data // mock 数据
  • .husky // 提供 git 钩子
  • build // wepback 打包配置
  • config // 基础服务类配置
    • development
    • mock
    • production
  • src // 页面内容
    • api // api 管理
    • assets // 静态资源
      • img
      • libs // axios 等全局配置
      • utils // 公共函数方法
    • components // 组件内容
    • App.tsx
    • index.txs
    • index.html
  • test // 单测

关于代码格式:eslint + prettier

  • eslint // 关于代码质量规范
  • prettier // 代码格式优化

commit 规范:commit lint

  • upd:更新某功能(不是 feat, 不是 fix)
  • feat:新功能(feature)
  • fix:修补 bug
  • docs:文档(documentation)
  • style: 格式(不影响代码运行的变动)
  • refactor:重构(即不是新增功能,也不是修改 bug 的代码变动)
  • test:增加测试
  • chore:构建过程或辅助工具的变动

提交检验:husky

  • pre-commit
  • commit-msg

mock 数据:json-sever

命令:npm run json-sever(注意端口号不要重复) mock 文件:_JSONMOCK_DATA

关于单测:jest

本地性能监控:web-vitals

配置文件:src/reportWebVitals.ts 使用方法: 方法一:在控制台打印

  • 将'src/reportWebVitals.ts'中修改为 export default=reportWebVitals(console.log);

方法二:使用谷歌扩展工具

  • 安装 web-vitals-extension

打包优化报告(wip)

命令:npm run build:report 配置文件:build/build.report.js

其他

qs lodash moment