@cloudflare/vite-plugin
1.70.1 · 19 Nov 2026MIT12.2M / weekRepositoryHomepagenpmAtom feed
1.70.1 is the newest release of 1.x.
In short
4 new2 fixed3 internal
Release note
Minor Changes
Allow Worker config to be customized in the plugin config
The Vite plugin can now be used to generate a Worker configuration instead of needing a Wrangler config file, or to customize an existing user-provided configuration.
This is done via a new
configoption on the plugin, which accepts either a partial Worker configuration object, or a function that receives the current configuration and returns a partial config object, or modifies the current config in place.import cloudflare from "@cloudflare/vite-plugin"; import { defineConfig } from "vite"; // Define a partial config object export default defineConfig({ plugins: [ cloudflare({ config: { compatibility_date: "2025-01-01", }, }), ], }); // Return a partial config from a function, conditional on some logic export default defineConfig({ plugins: [ cloudflare({ config: (workerConfig) => { if (workerConfig.name === "my-worker") { return { compatibility_flags: ["nodejs_compat"], }; } }, }), ], }); // Modify the config in place export default defineConfig({ plugins: [ cloudflare({ config: (workerConfig) => { workerConfig.compatibility_date = "2025-01-01"; }, }), ], });Containers: Allow users to directly authenticate external image registries in local dev
Previously, we always queried the API for stored registry credentials and used those to pull images. This means that if you are using an external registry (ECR, dockerhub) then you have to configure registry credentials remotely before running local dev.
Now you can directly authenticate with your external registry provider (using
docker loginetc.), and Wrangler or Vite will be able to pull the image specified in thecontainers.imagefield in your config file.The Cloudflare-managed registry (registry.cloudflare.com) currently still does not work with the Vite plugin.
Support zero-config operation
If the Vite plugin is used in a project without an existing Wrangler config file, it should be able to operate in "zero-config" mode by generating a default Wrangler configuration for an assets-only worker.
Register named entrypoints with the dev registry.
This enables binding to named entrypoints defined in a
vite devsession from anothervite devorwrangler devsession running locally.
Patch Changes
Ensure that
vite devandvite previewhard error with an appropriate error message when a remote proxy session is required but if the connection with it fails to be establishedWhen using remote bindings, either with
vite devorvite preview, the remote proxy session necessary to connect to the remote resources can fail to be created. This might happen if for example you try to set a binding with some invalid values such as:MY_R2: { type: "r2_bucket", bucket_name: "non-existent", // No bucket called "non-existent" exists remote: true, },Before, this could go undetected and cause unwanted behaviors such as requests handling hanging indefinitely. Now, a hard error will be thrown instead causing the vite process to crash, clearly indicating that something went wrong during the remote session's creation.
Make sure that the
account_idpresent in the user's config file is used for remote bindings
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.