SuperAPI AI 工具集

astro-webflow-to-vercel

通用与其它

查看项目

更新于 10-16 03:38

技能介绍

用途:把部署在 Webflow Cloud 上的 Astro 应用迁移到 Vercel。应用代码(页面、组件、Server Endpoints)基本不变,主要工作是替换适配器、清理 Cloudflare/Webflow 配置、迁移存储绑定与环境变量并完成部署。

主要能力:将 @astrojs/cloudflare 替换为 @astrojs/vercel(保持 output: "server");删除 webflow.json、wrangler.json、worker-configuration.d.ts;移除 base、build.assetsPrefix 与客户端手动前缀,并去掉 Server Endpoints 上的 runtime: 'edge' 指令;把 locals.runtime.env / Astro.locals.runtime.env 改为 process.env;用 Vercel Blob 替代 R2 对象存储、Redis 或 Edge Config 替代 Workers KV、Postgres 替代 SQLite;迁移环境变量并部署到 Vercel Functions。

使用方式:先运行 audit 脚本审计现有配置:bash scripts/audit.sh /path/to/project;随后卸载并安装适配器:npm uninstall @astrojs/cloudflare wrangler 与 npm install @astrojs/vercel;按需安装 SDK,如 npm i @vercel/blob;用 vercel env add、vercel link、vercel env pull 管理变量,最后经 Git 推送或 vercel --prod 部署。

适用场景:已在 Webflow Cloud 运行的 Astro 应用迁往 Vercel。限制:不适用于其他框架、全新应用或反向迁移;需要 Node.js 20+、Vercel 账号与 CLI,部分控制台操作及密钥由用户手动完成;创建账号、连接存储、设置变量值不能代做。