You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.5 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

## sameSystem
> 相同的项目,需要拆分为多个子项目进行部署,代码高度相似,可能只是区分一下皮肤和部分配置文件等
### 相同
* 入口文件共用包括index.html, App.vue, main.ts, vite.config.ts等
* 公共代码共用包括api, router, utils, components, directives等
* 依赖库共用所有子项目使用一份node_modules依赖库
* 环境相同dev, test, stg, prod环境数量相同
### 不同
* 环境内配置区分dev, test, stg, prod每个环境会注入不同的子系统配置如子系统名称api地址、登录态、权限等
### 问题
* 打包时需要在路由页面注释非当前项目的页面否则会把所有页面打包进去导致体积过大但是并不影响加载速度因为都是懒加载只有访问某个页面时才会记载对应的js文件。
---
---
## baseSystem
> 只有基础部分相同的项目需要拆分为多个子项目进行部署代码部分相似例如公共组件公共自定义指令公共utils等
### 相同
* 公共代码共用包括utils, components, directives等
* 依赖库共用所有子项目使用一份node_modules依赖库
* 环境相同dev, test, stg, prod环境数量相同
### 不同
* 入口文件区分包括index.html, App.vue, main.ts, vite.config.ts等都不相同
* 环境内配置区分dev, test, stg, prod每个环境会注入不同的子系统配置如子系统名称api地址、登录态、权限等