Skip to content

Deploy to Cloudflare Pages

Cloudflare Pages can build the site from Git or accept an already-built folder uploaded by Wrangler.

Official VitePress build settings:

SettingValue
Framework presetVitePress
Production branchmain
Build commandnpx vitepress build
Build output directory.vitepress/dist

Official reference: https://developers.cloudflare.com/pages/framework-guides/deploy-a-vitepress-site/

Option 1: Git Integration

  1. Push this project to a GitHub repository.
  2. Open the Cloudflare Dashboard.
  3. Go to Workers & Pages.
  4. Create a Pages application from an existing Git repository.
  5. Choose the repository and select the VitePress framework preset.
  6. Confirm the build command and output directory, then deploy.
text
Build command: npx vitepress build
Build output directory: .vitepress/dist

Option 2: Wrangler Upload

If Wrangler is logged in, deploy the built folder directly:

bash
npm run deploy

Equivalent commands:

bash
npm run build
npx wrangler pages deploy .vitepress/dist --project-name hideapps-docs

Use hideapps-docs as the Cloudflare Pages project name. The stable Pages domain is:

text
https://hideapps-docs.pages.dev

Built with VitePress and Cloudflare Pages.