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:
| Setting | Value |
|---|---|
| Framework preset | VitePress |
| Production branch | main |
| Build command | npx vitepress build |
| Build output directory | .vitepress/dist |
Official reference: https://developers.cloudflare.com/pages/framework-guides/deploy-a-vitepress-site/
Option 1: Git Integration
- Push this project to a GitHub repository.
- Open the Cloudflare Dashboard.
- Go to Workers & Pages.
- Create a Pages application from an existing Git repository.
- Choose the repository and select the VitePress framework preset.
- Confirm the build command and output directory, then deploy.
text
Build command: npx vitepress build
Build output directory: .vitepress/distOption 2: Wrangler Upload
If Wrangler is logged in, deploy the built folder directly:
bash
npm run deployEquivalent commands:
bash
npm run build
npx wrangler pages deploy .vitepress/dist --project-name hideapps-docsRecommended Project Name
Use hideapps-docs as the Cloudflare Pages project name. The stable Pages domain is:
text
https://hideapps-docs.pages.dev