发布:
- 新增 scripts/deploy.mjs、rollback.mjs、init-config.mjs 与 scripts/remote/{deploy,rollback}.sh
· 服务器上按 releases/<版本号> 存放,current 软链原子切换,发布/回滚都不中断服务
· 切换前校验 index.html 与引用的 /assets 资源完整,并补齐历史版本静态资源(旧 chunk 不 404)
· 真实配置 scripts/deploy.config.json 已加入忽略清单,模板 deploy.config.example.json 入库
- package.json 增加 deploy / rollback / deploy:init
接口地址:
- 新增 .env.production(VITE_API_BASE_URL=https://api.oms.gztbyc.com/api)与 .env.development
(/api,继续走 vite 代理到本地 6090)
- request.ts 的 baseURL 改为读 VITE_API_BASE_URL;env.d.ts 声明 ImportMetaEnv
- 新增 utils/media.ts#mediaUrl:跨域部署时把后端返回的相对地址(/api/files/raw/…)
补全为 API 站点绝对地址,用于 ImageUploader、商品列表图片、主体账号头像渲染
工程:
- tsconfig 去掉已弃用的 baseUrl(TS 7 将移除;paths 自 TS 4.1 起不再依赖它)
- .gitignore 增加 dist.tar.gz 与真实部署配置
25 lines
616 B
JSON
25 lines
616 B
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ES2020",
|
|
"useDefineForClassFields": true,
|
|
"module": "ESNext",
|
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
"skipLibCheck": true,
|
|
"moduleResolution": "bundler",
|
|
"allowImportingTsExtensions": true,
|
|
"resolveJsonModule": true,
|
|
"isolatedModules": true,
|
|
"moduleDetection": "force",
|
|
"noEmit": true,
|
|
"jsx": "preserve",
|
|
"strict": true,
|
|
"noUnusedLocals": true,
|
|
"noUnusedParameters": true,
|
|
"noFallthroughCasesInSwitch": true,
|
|
"paths": {
|
|
"@/*": ["./src/*"]
|
|
}
|
|
},
|
|
"include": ["src", "vite.config.ts", "env.d.ts"]
|
|
}
|