環境配置
標準環境打包
測試版:npm run build-test
預生產:npm run build-preview
正式版:npm run build
建議本地建里一個
.env.development.local 方便和后端聯調時修改配置相關信息。
和 src 同級有一下區分環境的文件:
.env.development
.env.test(測試環境)
.env.uat(預生產環境)
.env.preview(正式環境)
打包時命令行根據環境不同,見文件: src/hostMap.js
,
import { decrypt } from '../../utils'
const testOnline = 'xYMEaU*******JgvB6SzaPQLeasSIyz4vM4lcP11I='
const preOnline = 'Xn2wyp*******7BruSomIWNhWQrPnlybrl4ZbT/qng='
const prodOnline = 'vMHPK*******JwyJcnCHSfZFq9VRWOzYwh9BkZB0vnE='const xc = { // 信創版'test-xc': {'subApp1': `${decrypt(preOnline)}/online/` // *******測試環境},'preview-xc': {'subApp1': `${decrypt(preOnline)}/online/` // wujie-app1 *******預生產環境}
}
const normal = { // 標準版 wujie-app1test: {'subApp1': `${decrypt(testOnline)}/online/` // wujie-app1},preview: {'subApp1': 'https://*******org/online/' // 預生產},production: {'subApp1': 'https://*******org:99/online/' // 生產}
}
export default function hostMap(app) {const VUE_APP_ENV = process.env.VUE_APP_ENV // envconsole.log('-------------VUE_APP_SUB_1----------------', VUE_APP_ENV, process.env.VUE_APP_SUB_1)if (VUE_APP_ENV.includes('xc')) return xc[VUE_APP_ENV][app]if (VUE_APP_ENV === 'development') return process.env.VUE_APP_SUB_1return normal[VUE_APP_ENV][app]
}
GIT管理
【禁止test、pre、master互相合并!!!】
【禁止test、pre、合并到業務分支!!!】
開發階段: 基于master新建自己的本地分支(一般情況),其他情況咨詢主要開發者
轉測階段: 本地分支merge至分支:test
提測預生產: 本地分支merge至分支:pre
正式版: 本地分支merge至分支: master
branch 分類標準
主要格式:type(scope)-name
示例: feat(組建)-優化
commit 分類標準
主要格式:type(scope):message
示例: feat(組建):新增功能項
TYPE集合
feat:新功能(feature)
fix:修補
docs:文檔(documentation)
style: 格式(不影響代碼運行的變動)
refactor:重構(即不是新增功能,也不是修改bug的代碼變動)
perf:性能優化
test:增加測試
revert:撤銷上一次
chore:構建過程或輔助工具的變動
log: 加日志、注釋、調試打印