Files
cloudflare__vinext/packages/cloudflare
github-actions[bot] 5471b41eec chore: version packages (#2428)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-03 09:40:50 +00:00
..
2026-07-03 09:40:50 +00:00
2026-07-03 09:40:50 +00:00

@vinext/cloudflare

Cloudflare deployment tools and runtime adapters for vinext.

This package provides Cloudflare-specific cache and image backends for vinext:

  • kvDataAdapter() (@vinext/cloudflare/cache/kv-data-adapter) — backs the data cache (fetch, "use cache", unstable_cache) with a Workers KV namespace. Also used for ISR in the absence of a CDN adapter.
  • imagesOptimizer() (@vinext/cloudflare/images/images-optimizer) — backs next/image transformations with a Cloudflare Images binding.

Usage

Declare the adapters on the vinext() plugin in your Vite config:

import { kvDataAdapter } from "@vinext/cloudflare/cache/kv-data-adapter";
import { imagesOptimizer } from "@vinext/cloudflare/images/images-optimizer";

export default defineConfig({
  plugins: [
    vinext({
      cache: {
        data: kvDataAdapter(), // KV-backed data cache (binding: VINEXT_KV_CACHE)
      },
      images: { optimizer: imagesOptimizer() }, // Cloudflare Images binding: IMAGES
    }),
    cloudflare(),
  ],
});

Deploy

Deploy Cloudflare Workers projects with the package CLI:

npx @vinext/cloudflare deploy

With Vite+, use vpx @vinext/cloudflare deploy, or vp exec vinext-cloudflare deploy when running the locally installed bin.