github cloudflare/workers-sdk @cloudflare/vite-plugin@2.0.0-beta.v.0

latest releases: @cloudflare/remote-bindings@0.0.48, @cloudflare/containers-shared@0.22.0
pre-release3 hours ago

Major Changes

  • #16262 fe8ce54 Thanks @jamesopstad! - Load local Worker secrets with Vite-compatible file resolution

    The plugin now uses Vite's resolved mode and envDir when locating files that provide declared Worker secrets.

    CLOUDFLARE_ENV is no longer used to select mode-specific .dev.vars and .env files. Projects that relied on it should use Vite's --mode option instead. For preview, set the mode during vite build; vite preview uses the mode recorded in the Build Output.

    The deprecated WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME> environment variable is no longer supported. Rename Hyperdrive overrides to CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME>.

  • #16262 fe8ce54 Thanks @jamesopstad! - Remove legacy local testing endpoint rewrites

    The plugin no longer rewrites legacy local testing endpoints to their canonical /cdn-cgi/local/* and /__cf_local/* equivalents. Local-development scripts, tests, or integrations that call the legacy endpoints directly must update them as follows:

    • /cdn-cgi/handler/scheduled and /cdn-cgi/mf/scheduled → /cdn-cgi/local/scheduled
    • /cdn-cgi/handler/email → /cdn-cgi/local/email
    • /cdn-cgi/mf/stream/* → /__cf_local/stream/*
    • /cdn-cgi/mf/imagedelivery/* → /__cf_local/imagedelivery/*
    • /cdn-cgi/explorer/* → /cdn-cgi/local/explorer/*
  • #16262 fe8ce54 Thanks @jamesopstad! - Use native Cloudflare configuration and Build Output in Vite plugin v2

    Wrangler cannot deploy apps built with Vite plugin v2. Deploy with cf deploy instead.

    The plugin now loads Worker configuration from cloudflare.config.ts and no longer loads Wrangler configuration files. The configPath and experimental.newConfig options have been removed. Worker configuration supplied through the config, auxiliaryWorkers, and prerenderWorker plugin options now uses the native camelCase configuration format, and the exported WorkerConfig type has been updated to match.

    Projects using a Wrangler configuration file must move their Worker configuration to cloudflare.config.ts.

    Builds now always emit a structured Build Output in .cloudflare/output. When Containers are configured, vite build builds any Dockerfile-backed Container images and records them in the output. vite preview then reuses those images rather than rebuilding them when the preview server starts.

    Wrangler is no longer a runtime or peer dependency of the plugin.

  • #16262 fe8ce54 Thanks @jamesopstad! - Drop support for Vite 6

    The minimum supported Vite version is now Vite 7. Projects using Vite 6 must upgrade to Vite 7 or later before updating @cloudflare/vite-plugin to this release.

  • #16262 fe8ce54 Thanks @jamesopstad! - Default the entry Worker to the ssr Vite environment

    The entry Worker's Vite environment now defaults to ssr instead of deriving its name from the Worker name. Projects whose Vite configuration or plugins target the entry environment by its previous Worker-derived name must target environments.ssr, or preserve the previous name by setting viteEnvironment.name explicitly.

Minor Changes

  • #16262 fe8ce54 Thanks @jamesopstad! - Generate Worker types from cloudflare.config.ts

    The plugin now generates .cloudflare/types/index.d.ts during development and builds. Generated declarations infer bindings from cloudflare.config.ts and include runtime types for the configured compatibility date and flags by default. Use the top-level types option to disable generation or omit runtime types.

    Include the configuration and generated declarations in the TypeScript configuration for your Worker:

    {
      "include": ["src", "cloudflare.config.ts", ".cloudflare/types"]
    }

    The experimental.newConfig option, including experimental.newConfig.types, has been removed.

  • #16262 fe8ce54 Thanks @jamesopstad! - Stabilize the prerenderWorker plugin option

    Configure a dedicated prerender Worker with the top-level prerenderWorker option instead of experimental.prerenderWorker.

Patch Changes

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.