1pnpm add -D wrangler @cloudflare/vite-plugin
vite.config.ts:123456789101112131415import { cloudflare } from '@cloudflare/vite-plugin' import { holocron } from '@holocron.so/vite' import { defineConfig } from 'vite' export default defineConfig({ plugins: [ holocron(), cloudflare({ viteEnvironment: { name: 'rsc', childEnvironments: ['ssr'], }, }), ], })
wrangler.json or wrangler.jsonc:123456{ "name": "my-docs", "main": "spiceflow/cloudflare-entrypoint", "compatibility_date": "2026-04-13", "compatibility_flags": ["nodejs_compat"] }
12npx vite build npx wrangler deploy
base in vite.config.ts to mount the whole site under a path prefix, for example when the docs live at example.com/docs behind a route:1234export default defineConfig({ base: '/docs', plugins: [holocron(), cloudflare({ /* ... */ })], })
/docs/assets/app.js from dist/client/docs/assets/app.js:vite.config.ts build output request ┌───────────────────┐ ┌───────────────────────────┐ ┌────────────────────────┐ │ base: '/docs' │───────>│ dist/client/ │ │ GET /docs/assets/app.js│ │ │ │ .assetsignore │ └───────────┬────────────┘ │ HTML references │ │ docs/assets/app.js <───┼───────────────────┘ │ /docs/assets/* │ │ docs/icons/logo.svg │ served by the CDN, └───────────────────┘ └───────────────────────────┘ no Worker invocation
base, so this nesting is what makes subpath hosting work. It happens automatically; no ASSETS binding or extra config needed.example-cloudflare/ directory in the Holocron repo for a minimal Cloudflare Workers deployment.