1.2.0 • Published 2 years ago

taro-dylan-template v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

XX小程序模板

跨平台小程序项目(支持百度, 微信, 企业微信, 支付宝, 钉钉, 字节, H5)

命令

构建

yarn

or

npm install

启动

  npm run dev
  根据环境问题启动不同平台

打包

 npm run build
 根据环境问题打包不同平台

目录结构

├── config/                     # 项目配置
├── key/                        # CICD 等使用的秘钥
├── scripts/                    # 脚本文件
| ├── dev.ts                    # 开发脚本,使用 yarn dev 运行
| ├── build.ts                  # 打包脚本,使用 yarn build 运行
| ├── yapiToRequest.ts          # 运行 yarn ytt 时,同时在 srs/services 中生成请求接口的代码
| ├── getCdnImg.ts              # 将和此项目同目录下的 cdn 项目中的 mini 目录中的静态资源生成 src/images/cdnImages.ts 文件并统一导出
├── dist/                       # 打包文件
| ├── swan/                     # 百度平台
| ├── tt/                       # 字节平台
| ├── weapp/                    # 微信小程序平台
| ├── .../                      # 其它平台
└── src/                        # 源码
   ├── components/                 # 公共组件
   | ├── jgj/                      # jgj组件库
   | ├── .../                      # 其它组件
   ├── config/                     # baseUr了配置文件
   ├── constants/                  # 常量文件
   ├── context/                    # context
   ├── pages/                      # 页面
   | ├── .../                      # 其它分包
   | ├── tabBar/                   # tabBar 页面
   | | ├── tabBar1                 # 第一个 tabBar
   | | ├── tabBar2                 # 第二个 tabBar
   | | ├── tabBar3                 # 第三个 tabBar
   ├── services/                   # 接口层文件
   ├── hooks/                      # 自定义 hooks
   ├── static/                     # 静态文件
   ├── types/                      # 公共类型定义
   | ├──  api/                     # ytt 生成的后端接口类型定义
   | ├──  service/                 # 手写的后端接口类型定义
   ├── utils/                      # 工具文件
   | ├── compatibility.ts          # 兼容性 API 封装
   | ├── routeTo.ts                # 统一路由跳转封装函数

配置(可选)

项目打包配置文件 /config/index.js

项目环境 baseUrl 配置文件 /src/config.index.ts