cloudflare/workers-sdk @cloudflare/vite-plugin@1.40.0
cloudflare/workers-sdk
Captured source
source ↗@cloudflare/vite-plugin@1.40.0
Repository: cloudflare/workers-sdk
Tag: @cloudflare/vite-plugin@1.40.0
Published: 2026-06-05T10:47:38Z
Prerelease: no
Release notes:
Minor Changes
- #14013 `3cf9d0e` Thanks @jamesopstad! - Add experimental
experimental.newConfigoption to load the entry Worker's configuration fromcloudflare.config.ts
This is an experimental, opt-in feature. When enabled, the plugin loads the entry Worker's configuration from a cloudflare.config.ts file instead of the usual wrangler.json / wrangler.jsonc / wrangler.toml.
Pass true to enable with defaults, or an object to customise behaviour. Currently the only sub-option is types.generate (defaults to true), which writes a worker-configuration.d.ts file next to the config. This enables typed env and exports for your Worker and currently assumes that you have @cloudflare/workers-types installed.
// 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.ts schema, and the @cloudflare/vite-plugin/experimental-config exports may change in any release.
Patch Changes
Notability
notability 3.0/10Routine plugin version release, no notable traction