Packages

@cloudflare/vite-plugin

1.70.1 · 19 Nov 2026MIT12.2M / weekRepositoryHomepagenpmAtom feed

Your version

1.16.0

2 Dec 2025Where it was published

1.70.1 is the newest release of 1.x.

npm marks 1.16.0 as deprecated: Issue with dependency. Downgrade to 1.15.3

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 config option 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 login etc.), and Wrangler or Vite will be able to pull the image specified in the containers.image field 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 dev session from another vite dev or wrangler dev session running locally.

Patch Changes

  • Ensure that vite dev and vite preview hard error with an appropriate error message when a remote proxy session is required but if the connection with it fails to be established

    When using remote bindings, either with vite dev or vite 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_id present 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.