Cloudflare Pages
Use Cloudflare Pages as a static host for the Docusaurus build output.
Build settings
Set these values in Cloudflare Pages:
| Setting | Value |
|---|---|
| Framework preset | None |
| Build command | npm run build |
| Build output directory | build |
| Root directory | / |
| Node.js version | 22 |
What the build does
npm run build runs Docusaurus first, then Pagefind:
npm run build:site
npm run index:search
The generated build/pagefind/ directory is deployed with the rest of the static site.
GitHub deployment flow
- Push changes to
main. - Cloudflare Pages installs dependencies from
package-lock.json. - Cloudflare Pages runs
npm run build. - Cloudflare Pages serves the generated
build/directory.