Skip to content

Migrate a static site or SPA from Vercel to Cloudflare Workers

Last updated View as MarkdownAgent setup

This guide moves a static site or single-page application (SPA) from Vercel to Cloudflare Workers. Use it if your project does not render pages on the server. Workers Static Assets serves your build output, so you do not need a framework adapter.

Before you begin

Review the steps in Before you begin that apply to every framework.

Migrate your site

  1. In the Vercel dashboard, go to your project's Settings > Build & Development settings. Note the Build Command and Output Directory values.

    Finding the Build Command and Output Directory fields
  2. In the root of your project, create a Wrangler configuration file. Replace <your-project-name> with your project name, and <your-build-directory> with the output directory, for example ./dist.

    For a static site:

    {
    	"name": "<your-project-name>",
    	// Set this to today's date
    	"compatibility_date": "2026-11-06",
    	"assets": {
    		"directory": "<your-build-directory>",
    	},
    }
    name = "<your-project-name>"
    # Set this to today's date
    compatibility_date = "2026-11-06"
    
    [assets]
    directory = "<your-build-directory>"

    For a single-page application, add not_found_handling:

    {
    	"name": "<your-project-name>",
    	// Set this to today's date
    	"compatibility_date": "2026-11-06",
    	"assets": {
    		"directory": "<your-build-directory>",
    		"not_found_handling": "single-page-application",
    	},
    }
    name = "<your-project-name>"
    # Set this to today's date
    compatibility_date = "2026-11-06"
    
    [assets]
    directory = "<your-build-directory>"
    not_found_handling = "single-page-application"
  3. Build your project, then deploy it:

    npx wrangler deploy
  4. To deploy on every push, connect your repository to Workers Builds. Use the same build command as on Vercel, and use npx wrangler deploy as the deploy command.

Was this helpful?