> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: Cloudflare Workers
description: Deploy Holocron to Cloudflare Workers.
icon: cloud
---

# Cloudflare Workers

Holocron can be deployed to Cloudflare Workers for edge-rendered docs with global distribution.

## Setup

Install wrangler and the Cloudflare Vite plugin:

```bash
pnpm add -D wrangler @cloudflare/vite-plugin
```

Add the Cloudflare plugin after Holocron in `vite.config.ts`:

```ts
import { 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'],
      },
    }),
  ],
})
```

Create a `wrangler.jsonc`:

```jsonc
{
  "name": "my-docs",
  "main": "spiceflow/cloudflare-entrypoint",
  "compatibility_date": "2026-04-14",
  "compatibility_flags": ["nodejs_compat"]
}
```

## Build and deploy

```bash
npx vite build
npx wrangler deploy
```

## Custom entry with Workers

If you use a [custom entry](/custom-entry), your Spiceflow app runs as the Worker entry point. You can add Cloudflare-specific bindings (KV, D1, AI) alongside your docs.

## Example project

See the `example-cloudflare/` directory in the Holocron repo for a working Cloudflare Workers deployment.


---

*Powered by [holocron.so](https://holocron.so)*
