Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions now.json

This file was deleted.

3 changes: 3 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"framework": "umijs"
}
Comment on lines +1 to +3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The previous now.json configuration specified a project name with "name": "rc-select". To ensure consistency and prevent the project name on Vercel from changing unexpectedly, it's recommended to also add the name property to your vercel.json configuration.

Suggested change
{
"framework": "umijs"
}
{
"name": "rc-select",
"framework": "umijs"
}

Comment on lines +1 to +3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

验证UmiJS框架标识符和配置完整性

需要确认"umijs"是否为Vercel支持的有效框架标识符,并验证这个最小化配置是否满足项目的部署需求。建议检查原始now.json中是否包含其他需要迁移的配置(如构建命令、输出目录、环境变量等)。

请运行以下脚本验证框架配置的有效性:

另外,您可以通过查阅最新的Vercel框架支持文档来确认"umijs"是否为有效的框架标识符:


🏁 Script executed:

#!/bin/bash
# 搜索项目中是否存在now.json或其备份,查看原始配置内容
fd -e json -type f | grep -E "(now|vercel)" | head -20

# 检查package.json中的UmiJS相关依赖
cat package.json | grep -A 5 -B 5 "umi"

Length of output: 1011


🌐 Web query:

Vercel supported frameworks list umijs

💡 Result:

Yes — Vercel lists UmiJS as a supported framework and provides a deployment guide. See Vercel's supported frameworks list and the UmiJS deploy guide. [1][2]

Sources:
[1] Vercel — Supported Frameworks (includes UmiJS).
[2] Vercel guide: "How to Deploy an UmiJS App with Vercel" (deployment instructions).


需要进一步搜索now.json文件以验证配置完整性。让我运行修正的脚本:


---

🏁 Script executed:

```shell
#!/bin/bash
# 搜索now.json和vercel.json文件
fd -e json -type file | grep -E "(now|vercel)"

# 如果now.json存在,显示其内容
if [ -f "now.json" ]; then
  echo "=== now.json content ==="
  cat now.json
fi

# 如果vercel.json存在,显示其内容
if [ -f "vercel.json" ]; then
  echo "=== vercel.json content ==="
  cat vercel.json
fi

Length of output: 225


需要验证最小化配置是否充分。让我检查项目的构建配置:


---

🏁 Script executed:

```shell
#!/bin/bash
# 搜索项目中的部署相关配置文件
ls -la | grep -E "(vercel|now|build|\.vercel)"

# 检查是否存在构建或部署相关的环境配置
find . -maxdepth 2 -name ".*" -o -name "*config*" | grep -v node_modules | head -20

# 查看package.json中的build脚本
echo "=== Build scripts ==="
grep -A 2 '"build"' package.json

Length of output: 402


需要最后确认Vercel对UmiJS最小配置的支持情况:


---

🌐 Web query:

```web
Vercel UmiJS minimal configuration framework only

💡 Result:

Summary — minimal Vercel setup to deploy an UmiJS app (static output)

  1. package.json (scripts)
  • Ensure you have a build script that runs Umi:
    {
    "scripts": {
    "build": "npx umi build",
    "dev": "npx umi dev",
    "start": "npx umi dev"
    }
    }
  1. vercel.json (minimal, puts Vercel build and serves Umi's dist)
  • Create vercel.json at project root:
    {
    "buildCommand": "npx umi build",
    "outputDirectory": "dist"
    }

Notes

  • Umi’s production build outputs to dist by default (so outputDirectory = "dist"). [1]
  • Vercel will run the buildCommand and serve the files from outputDirectory. Use vercel.json properties buildCommand/outputDirectory to override project settings. [2][3]
  • If your Umi app needs server-side Node APIs (not just static files), you’ll need a different configuration (Vercel Functions or a server runtime) — the above is for static-only builds.

Sources
[1] Umi build output ("npx umi build" → dist).
[2] Vercel docs — vercel.json: buildCommand / outputDirectory.
[3] Vercel project-configuration docs / changelog (per-deployment overrides).


补充buildCommand和outputDirectory配置

vercel.json配置不完整。虽然"umijs"是Vercel支持的有效框架标识符,但Vercel建议在vercel.json中显式指定buildCommand和outputDirectory来确保正确部署。根据UmiJS的默认构建输出为dist目录,建议修改为:

{
  "buildCommand": "npm run build",
  "outputDirectory": "dist"
}

注意:项目中build脚本为"dumi build"而非"umi build",请确保这与UmiJS的默认构建行为兼容,或根据实际输出目录调整outputDirectory的值。

🤖 Prompt for AI Agents
In vercel.json around lines 1 to 3, the config only specifies "framework":
"umijs" and lacks explicit buildCommand and outputDirectory; add a buildCommand
(e.g. "npm run build") and an outputDirectory (e.g. "dist") to ensure Vercel
builds and serves the correct output, and if the project's package.json uses a
different build script (here "dumi build") or outputs to a different folder, set
buildCommand to that script and outputDirectory to the actual build output
directory accordingly.

Loading