Di chuyển từ Vercel to Workers Migrate from Vercel to Workers
Hướng dẫn chi tiết đồng bộ từ docs Cloudflare — mỗi section có backlink tới đúng vị trí trên trang gốc. Detailed guide synced from Cloudflare docs — each section links to the matching anchor on the official page.
← Danh mục ← CatalogGiải thích nhanh Quick context
Thuộc Developer Platform — thực hành triển khai code, API và dữ liệu trên edge/serverless. Tutorial «Di chuyển từ Vercel to Workers» giúp bạn làm quen luồng triển khai thật — phù hợp đọc trước khi mở tài liệu gốc tiếng Anh. Đọc phần tóm tắt và lưu ý trước — sau đó mở docs gốc để copy lệnh và cấu hình chi tiết.
Migrate your Vercel application to Cloudflare Workers. You should already have an existing project deployed on Vercel that you would like to host on Workers.
Lưu ý trước khi làm Notes before you start
- Đây là bản tóm tắt trên Orange Cloud Learning Hub — không thay thế tài liệu chính thức. This is a summary on Orange Cloud Learning Hub — it does not replace the official documentation.
- Luôn mở liên kết «Tài liệu gốc» bên dưới khi cần lệnh CLI, snippet code và ảnh minh họa đầy đủ. Open the Official docs link below for CLI commands, code snippets, and full screenshots.
- Cần tài khoản Cloudflare, Wrangler CLI và (thường) hoàn thành hướng dẫn Get started của Workers/Pages. Requires a Cloudflare account, Wrangler CLI, and (typically) completing the Workers/Pages Get started guide.
- Docs Cloudflare cập nhật thường xuyên — đối chiếu ngày «Rà soát lần cuối» trên trang gốc khi triển khai production. Cloudflare docs change frequently — verify the Last reviewed date on the official page before production use.
Tài liệu gốc — rà soát lần cuối: about 1 year ago Official docs — last reviewed: about 1 year ago
Tổng quan Overview
Trong tutorial này, bạn sẽ migrate your Vercel application to Cloudflare Workers.
Read the "Overview" section below — open the official docs link for full screenshots and configuration tabs.
In this tutorial, you will learn how to migrate your Vercel application to Cloudflare Workers.
You should already have an existing project deployed on Vercel that you would like to host on Cloudflare Workers. Vercel specific features are not supported by Cloudflare Workers. Review the Workers compatibility matrix for more information on what is supported.
Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs)
Frameworks Frameworks
Phần «Frameworks» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Frameworks" section below — open the official docs link for full screenshots and configuration tabs.
Some frameworks like Next.js, Astro with on demand rendering, and others have specific guides for migrating to Cloudflare Workers. Refer to our framework guides for more information. If your framework has a Deploy an existing project on Workers guide, follow that guide for specific instructions. Otherwise, continue with the steps below.
Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs)
Find your build command và build directory Find your build command and build directory
Phần «Find your build command và build directory» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Find your build command and build directory" section below — open the official docs link for full screenshots and configuration tabs.
To move your application to Cloudflare Workers, you will need to know your build command and build directory. Cloudflare Workers will use this information to build and deploy your application. We'll cover how to find these values in the Vercel Dashboard below.
In your Vercel Dashboard, find the project you want to migrate to Workers. Go to the Settings tab for your specific project and find the Build & Development settings panel. You will find the Build Command and Output Directory fields there. If you are using a framework, these values may not be filled in but will show the defaults used by the framework. Save these for deploying to Cloudflare Workers. In the below image, the Build Command is npm run build, and the Output Directory is dist.
Tạo wrangler file Create a wrangler file
Phần «Tạo wrangler file» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Create a wrangler file" section below — open the official docs link for full screenshots and configuration tabs.
In the root of your project, create a wrangler.jsonc or wrangler.toml file (wrangler.jsonc is recommended). What goes in the file depends on what type of application you are deploying: static or single-page application.
For each case, be sure to update the <your-project-name> value with the name of your project and <your-build-directory> value with the build directory from Vercel. Be sure to set the right pathing, for example ./dist if the build directory is dist or ./build if your build directory is build.
For a static site, you will need to add the following to your wrangler file.
JSONC
{
"name": "<your-project-name>",
// Set this to today's date
"compatibility_date": "2026-06-10",
"assets": {
"directory": "<your-build-directory>",
},
} TOML
name = "<your-project-name>"
# Set this to today's date
compatibility_date = "2026-06-10"
[assets]
directory = "<your-build-directory>" For a single page application, you will need to add the following to your wrangler file, which includes the notfoundhandling field.
JSONC
{
"name": "<your-project-name>",
// Set this to today's date
"compatibility_date": "2026-06-10",
"assets": {
"directory": "<your-build-directory>",
"not_found_handling": "single-page-application",
},
} TOML
name = "<your-project-name>"
# Set this to today's date
compatibility_date = "2026-06-10"
[assets]
directory = "<your-build-directory>"
not_found_handling = "single-page-application" Some frameworks provide specific guides for migrating to Cloudflare Workers. Please refer to our framework guides for more information. If your framework includes a “Deploy an existing project on Workers” guide, follow it for detailed instructions.
Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs)
Tạo Workers dự án mới Create a new Workers project
Phần «Tạo Workers dự án mới» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Create a new Workers project" section below — open the official docs link for full screenshots and configuration tabs.
Your application has the proper configuration to be built and deployed to Cloudflare Workers.
The Connect a new Worker guide will instruct you how to connect your GitHub project to Cloudflare Workers. In the configuration step, ensure your build command is the same as the command you found on Vercel. Also, the deploy command should be the default npx wrangler deploy.
Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs)
Thêm custom domain Add a custom domain
Phần «Thêm custom domain» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Add a custom domain" section below — open the official docs link for full screenshots and configuration tabs.
Workers Custom Domains only supports domains that are configured as zones on your account. A zone refers to a domain (such as example.com) that Cloudflare manages for you, including its DNS and traffic.
Follow these instructions for adding a custom domain to your Workers project. You will also find additional information on creating a zone for your domain.
Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs)
Xó your Vercel app Delete your Vercel app
Phần «Xó your Vercel app» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Delete your Vercel app" section below — open the official docs link for full screenshots and configuration tabs.
Once your custom domain is set up and sending requests to Cloudflare Workers, you can safely delete your Vercel application.
Xử lý sự cố Troubleshooting
Phần «Xử lý sự cố» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Troubleshooting" section below — open the official docs link for full screenshots and configuration tabs.
For additional migration instructions, review the Cloudflare Pages to Workers migration guide. While not Vercel specific, it does cover some additional steps that may be helpful.
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/directory/","name":"Directory"}},{"@type":"ListItem","position":2,"item":{"@id":"/workers/","name":"Workers"}},{"@type":"ListItem","position":3,"item":{"@id":"/workers/static-assets/","name":"Static Assets"}},{"@type":"ListItem","position":4,"item":{"@id":"/workers/static-assets/migration-guides/","name":"Migration Guides"}},{"@type":"ListItem","position":5,"item":{"@id":"/workers/static-assets/migration-guides/vercel-to-workers/","name":"Migrate from Vercel to Workers"}}]} Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs)
Xem bản đầy đủ trên developers.cloudflare.com (ảnh, tab cấu hình). View the full guide on developers.cloudflare.com (images, config tabs).
Tài liệu gốc ↗ Official docs ↗