Deploy guide

How to deploy Vite to Cloudflare Pages

The settings to enter and where to find them: Vite on Cloudflare Pages, built on every push.

Checked 16 October 2026

In short

The settings

Framework preset

Usually picked for you on import.

Build command
Build output directory

Step by step

Set it up

  1. 1

    Put the project in a Git repository

    Push it to GitHub, GitLab or Bitbucket. Cloudflare Pages builds from the repository, so the build folder (dist) doesn't need to be committed.

  2. 2

    Import it in Cloudflare Pages

    Start a new project from the repository and give Cloudflare Pages access to it when it asks.

    Workers & Pages→Create application→Pages→Connect to Git

  3. 3

    Check the build settings

    Cloudflare Pages usually recognises Vite and fills these in. Make sure they read:

    Framework preset

    Usually picked for you on import.

    Build command
    Build output directory
  4. 4

    Deploy

    Start the deploy. When the build finishes, the site is at https://YOUR-PROJECT.pages.dev. Each push to the main branch deploys again, and other branches and pull requests get preview links.

    To change the settings later: Workers & Pages → Your project → Settings.

Good to know

Common snags

  • Single-page apps work as they are on Cloudflare Pages: without a 404.html, unknown paths get the home page, and the app routes from there.
  • Node.js version: Set a NODE_VERSION environment variable, or add an .nvmrc or .node-version file. The current build image starts on Node 22.

Stuck? The usual problems, solved

Questions

Before you start

Why does refreshing a page give a 404?

With a router (React Router, Vue Router and the like) a path like /about has no file of its own. Leave out a top-level 404.html and Cloudflare Pages serves the app for every path.

Is Cloudflare Pages free for this?

A generous free plan. Workers paid plans for more builds and functions.

How do I use my own domain?

Add it in Cloudflare Pages's domain settings, then add the DNS records at your registrar. Our custom domain guides have the exact records for Cloudflare Pages at each registrar.

The build works on my computer but fails here. Why?

Most often a different Node.js version, or a package that's installed on your computer but missing from package.json. Set a NODE_VERSION environment variable, or add an .nvmrc or .node-version file. The current build image starts on Node 22.

Next step: connect your own domain to Cloudflare Pages.

Rather skip git and build settings?

Build on your computer with npm run build, then drop the dist folder (or a zip of it) on 99helpers. It's online at its own address in seconds, with no repository, workflow or base path to set up. Passwords, analytics, your own domain and AI editing are built in.

Drop your Vite site on 99helpersSee the steps

Or skip the setup

Drop it in. It's online in seconds.

A file, a folder or a whole site: 99helpers puts it online at its own address, with no git, no build settings and no DNS to start with. Add your own domain whenever you're ready.