Skip to content
brought to you byVoidZero

Plugin and Configuration ​

voidPlugin(options?) ​

Named export from "void". Returns an array of Vite plugins that set up file-based routing, migration support, and the Cloudflare Workers runtime. Application-level configuration is read from void.config.ts; the optional options object controls Vite/Cloudflare plugin behavior.

ts
import { voidPlugin } from 'void';

export default defineConfig({
  plugins: [voidPlugin()],
});
OptionTypeDescription
persistTostringDirectory path for persisting local dev state (D1, KV, R2). Defaults to .void/ in the project root.
auxiliaryWorkersAuxiliaryWorkerConfig[]Additional Workers to run alongside your app, such as a separate API Worker and dashboard that share bindings. Each entry accepts configPath (JSON, JSONC, or TOML), config (settings or a callback), viteEnvironment, and devOnly.

Project configuration ​

defineConfig(config) ​

Import from void/config in the root void.config.ts. It returns the config with editor completion and TypeScript checking. Void validates the result when loading it, including values computed at runtime.

ts
import { defineConfig } from 'void/config';

export default defineConfig({
  cloudflare: { name: 'my-app' },
  routing: { revalidate: 60 },
});

See the config reference for all fields.