chore: build and deploy web-antd [skip ci]
This commit is contained in:
@@ -72,6 +72,7 @@ bash scripts/deploy/build-and-push.sh
|
||||
- 安装依赖(如果需要)
|
||||
- 执行构建
|
||||
- 检查构建结果
|
||||
- 使用 `--no-verify` 跳过 pre-commit hooks(避免检查大量构建产物文件)
|
||||
- 提示是否提交并推送
|
||||
|
||||
### 方式二:手动操作
|
||||
@@ -216,6 +217,37 @@ pnpm dev:antd
|
||||
3. 清理并重新安装依赖:`pnpm clean && pnpm install`
|
||||
4. 查看详细错误信息:`pnpm build:antd --verbose`
|
||||
|
||||
### 问题:构建后使用了开发环境配置(如 localhost:5666)
|
||||
|
||||
**可能原因**:
|
||||
1. 构建时环境变量被开发环境配置覆盖
|
||||
2. 浏览器缓存了旧的配置
|
||||
3. Service Worker 缓存了旧版本
|
||||
|
||||
**解决方案**:
|
||||
|
||||
1. **确保使用生产环境构建**:
|
||||
- 脚本已自动设置 `NODE_ENV=production`
|
||||
- 构建命令使用 `--mode production`
|
||||
- 检查 `.env.production` 文件中的 `VITE_GLOB_API_URL` 配置
|
||||
|
||||
2. **清除浏览器缓存**:
|
||||
- 硬刷新:`Ctrl+Shift+R` (Windows) 或 `Cmd+Shift+R` (Mac)
|
||||
- 清除浏览器缓存和 Cookie
|
||||
- 使用无痕模式测试
|
||||
|
||||
3. **检查构建产物**:
|
||||
```bash
|
||||
# 检查构建后的配置文件
|
||||
cat apps/web-antd/dist/_app.config.js
|
||||
# 应该显示:VITE_GLOB_API_URL 为 "/admin-api" 或正确的生产环境地址
|
||||
```
|
||||
|
||||
4. **如果仍有问题**:
|
||||
- 删除 `apps/web-antd/dist` 目录
|
||||
- 重新构建:`pnpm build:antd`
|
||||
- 检查是否有 `.env.local` 文件覆盖了配置
|
||||
|
||||
### 问题:推送后 CI/CD 未触发
|
||||
|
||||
**可能原因**:
|
||||
|
||||
Reference in New Issue
Block a user