feat: 初始化项目配置和基础架构
- 添加项目配置文件:.vercelignore、.codex/config.toml、postcss.config.js、.prettierrc 等 - 设置构建工具链:Vite + React + TypeScript + TailwindCSS - 添加核心组件:HeaderBar、TierRow、ItemCard、Pool - 配置 CI/CD 和部署相关文件:vercel.json、DEPLOY.md - 添加开发工具配置:ESLint、Prettier、EditorConfig - 实现基础功能:拖拽排序、图片处理、状态管理
This commit is contained in:
32
DEPLOY.md
Normal file
32
DEPLOY.md
Normal file
@ -0,0 +1,32 @@
|
||||
# Vercel 部署说明
|
||||
|
||||
## 环境要求
|
||||
- Node.js 18+
|
||||
- 使用 `VITE_*` 前缀的环境变量(在 Vercel 仪表盘设置)
|
||||
|
||||
## 本地命令
|
||||
- 开发:`npm run dev`
|
||||
- 构建:`npm run build`
|
||||
- 预览:`npm run preview`
|
||||
|
||||
## Vercel 配置
|
||||
- `vercel.json`:
|
||||
- `framework: vite`
|
||||
- `buildCommand: npm run build`
|
||||
- `outputDirectory: dist`
|
||||
- `rewrites`: `/(.*)` -> `/index.html`(SPA 路由)
|
||||
- `.vercelignore`:忽略 `node_modules`, `.git`, `dist`, `build`, `.env`, `.env.*` 等
|
||||
|
||||
## 部署步骤
|
||||
1. 安装 CLI:`npm i -g vercel`
|
||||
2. 连接项目:`vercel`(按提示选择或使用现有项目)
|
||||
3. 生产部署:`vercel --prod`
|
||||
|
||||
## 路由与静态资源
|
||||
- 任意前端路由(例如 `/pool/123`)均通过重写落到 `index.html`
|
||||
- 静态资源请放置在 `public/` 或通过 Vite 资产处理引入
|
||||
|
||||
## 环境变量示例
|
||||
- `VITE_API_BASE=https://api.example.com`
|
||||
- 在代码中通过 `import.meta.env.VITE_API_BASE` 访问
|
||||
|
||||
Reference in New Issue
Block a user