@cloudflare/vite-plugin
1.70.1 · 19 Nov 2026MIT12.3M / weekRepositoryHomepagenpmAtom feed
1.70.1 is the newest release of 1.x.
In short
1 new2 internal
Release note
Minor Changes
Add experimental
experimental.newConfigoption to load the entry Worker's configuration fromcloudflare.config.tsThis is an experimental, opt-in feature. When enabled, the plugin loads the entry Worker's configuration from a
cloudflare.config.tsfile instead of the usualwrangler.json/wrangler.jsonc/wrangler.toml.Pass
trueto enable with defaults, or an object to customise behaviour. Currently the only sub-option istypes.generate(defaults totrue), which writes aworker-configuration.d.tsfile next to the config. This enables typedenvandexportsfor your Worker and currently assumes that you have@cloudflare/workers-typesinstalled.// vite.config.ts import { defineConfig } from "vite"; import { cloudflare } from "@cloudflare/vite-plugin"; export default defineConfig({ plugins: [ cloudflare({ experimental: { newConfig: true, }, }), ], });// cloudflare.config.ts import { defineWorker, bindings, } from "@cloudflare/vite-plugin/experimental-config"; import * as entrypoint from "./src/index.ts" with { type: "cf-worker" }; export default defineWorker((ctx) => ({ name: "my-worker", entrypoint, compatibilityDate: "2026-05-18", env: { MY_TEXT: bindings.text(`The mode is ${ctx.mode}`), MY_KV: bindings.kv(), }, }));A few limitations apply while the feature is experimental:
configPathcannot be combined withexperimental.newConfig. The entry Worker is always loaded fromcloudflare.config.tsat the project root.auxiliaryWorkersare not yet supported withexperimental.newConfig.
Because this is experimental, the option, the
cloudflare.config.tsschema, and the@cloudflare/vite-plugin/experimental-configexports may change in any release.
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.