Skip to main content
Deploy Vite applications to Cloudflare Workers with automatic configuration and local development support.

Installation

Install the required dependencies:

Configuration

Configuration Options

The Vite resource extends Website and accepts all its properties:

Properties

  • entrypoint (optional): Path to the worker entrypoint file
    • Default: undefined (SPA mode)
  • assets (optional): Path to static assets directory
    • Default: dist/client (if entrypoint provided), otherwise dist
  • bindings: Cloudflare bindings (KV, R2, D1, etc.)
  • dev: Local development configuration
  • build: Build command override
    • Default: Automatically detected from package manager

Server-Side Rendering

For SSR applications, provide an entrypoint:

Local Development

The Alchemy Vite plugin automatically:
  • Configures Cloudflare Workers runtime
  • Provides access to bindings in development
  • Ignores .alchemy directory from file watching
Start the dev server: