285 KiB
@cloudflare/vite-plugin
1.44.0
Minor Changes
-
#14535
1b965c5Thanks @Naapperas! - Support dynamic retry delays for Workflow steps in local devA step's
retries.delaycan now be a function that computes the delay per failed attempt, in addition to a static duration. The function receives{ ctx, error }and returns a delay (a number of milliseconds or a duration string like"30 seconds"), and its result is fed into the configuredbackoff.await step.do( "call flaky API", { retries: { limit: 5, backoff: "constant", delay: ({ ctx }) => ctx.attempt * 1000, }, }, async () => { /* ... */ } );The function is invoked once per failed attempt with a 5 second timeout. If it throws, times out, or returns an invalid value, the step fails without further retries.
Patch Changes
1.43.3
Patch Changes
1.43.2
Patch Changes
1.43.1
Patch Changes
- Updated dependencies [
e7e5780,d88555e,5fd8bee,5d9990e,bf49a41,1ac96a1,f416dd9,1ca8d8f,16fbf81,b973ed3]:
1.43.0
Minor Changes
-
#14382
fd92d56Thanks @petebacondarwin! - Add support for declarative Durable Object exportswrangler deploynow accepts anexportsmap inwrangler.jsonas a declarative alternative to the legacymigrationsarray.Each entry in
exportsis keyed by Durable Object class name.typecarries the export kind (currently always"durable-object"); thestatefield carries the lifecycle and defaults to"created"(live) when omitted:{ "exports": { // Provision a new Durable Object class (`MyDO`) "MyDO": { "type": "durable-object", "storage": "sqlite" }, // Delete Durable Object class (`OldGone`) "OldGone": { "type": "durable-object", "state": "deleted" }, // Rename a Durable Object class (from `OldName` to `NewName`) "OldName": { "type": "durable-object", "state": "renamed", "renamed_to": "NewName" }, "NewName": { "type": "durable-object", "storage": "sqlite" }, // Transfer a Durable Object (`Outgoing`) to a new Worker (`target-worker`) "Outgoing": { "type": "durable-object", "state": "transferred", "transferred_to": "target-worker" }, // Prepare to receive the transfer of a Durable Object (`Incoming`) from another Worker (`source-worker`) "Incoming": { "type": "durable-object", "state": "expecting-transfer", "storage": "sqlite", "transfer_from": "source-worker" } } }When a Worker declares Durable Object class bindings but no lifecycle for them (neither a
migrationsarray nor anexportsmap), wrangler warns and now suggests a declarativeexportsentry for each class (previously it suggested a legacymigrationsblock).The deployment response now surfaces the server's reconciliation result — created namespaces, applied tombstones, structured per-scenario info entries, and a
removable_entrieshint for stale tombstones that are safe to delete from the config. Blocking errors return the structured per-class detail with scenario tags, suggested remediation, and any referencing-script context.wrangler versions uploadalso forwardsexports. Declarativeexportslifecycle changes are reconciled when the version is deployed (wrangler versions deployorwrangler deploy), so aversions uploadpayload can declare new classes inexportswithout immediately provisioning them. An actor binding (durable_objects.bindings) to a class declared only inexportson the sameversions uploadis rejected with a clear error (code 100406) — the binding cannot be resolved until the namespace is provisioned. Either stage the new class viactx.exports.X(no binding required) onversions uploadand add the binding at deploy time, or usewrangler deployto provision and bind in one step (the same constraint applies to themigrationsflow).Multi-version deploys (
wrangler versions deploy A@50% B@50%) where the selected versions disagree on declarativeexportsare rejected server-side with a clear message: deploy the version that changesexportsat 100% first, then run the percentage-split deploy. This prevents traffic on one branch routing to code that references unprovisioned or just-deleted DO namespaces. Single-version (100%) deploys are unaffected.Local development (
wrangler dev,vite devandunstable_startWorker) reads Durable Object SQLite storage settings from the newexportsfield, so applications using the declarative flow get correct local-dev storage without needing to also declare amigrationsblock.@cloudflare/vitest-pool-workersalso picks up Durable Object configuration fromexports, so tests against anexports-only Worker run with the correct local SQLite storage and can reach unbound Durable Object classes viactx.exports.X.wrangler typesis also aware ofexports. Live entries (includingexpecting-transfer, the receiving side of a two-phase transfer) are added toCloudflare.GlobalProps.durableNamespaces, which typesctx.exports.Xfor unbound Durable Objects declared only viaexports.
Patch Changes
1.42.4
Patch Changes
-
#14490
75d8cb0Thanks @petebacondarwin! - Preserve D1 migration paths in generated Worker configsWhen a Worker config with a D1 binding is built by the Vite plugin, the generated
wrangler.jsonnow pointsmigrations_dirback to the source migration directory. This lets tools that read the generated config, such ascreateTestHarness(), find the same D1 migrations as the source Worker config. -
Updated dependencies [
75d8cb0,75d8cb0,75d8cb0,75d8cb0,75d8cb0,f10d4ad,75d8cb0,75d8cb0,75d8cb0,75d8cb0,d292046,75d8cb0,75d8cb0,75d8cb0,75d8cb0,75d8cb0,75d8cb0,e0cc2cb,75d8cb0,75d8cb0,75d8cb0]:
1.42.3
Patch Changes
1.42.2
Patch Changes
-
#14358
4ef872fThanks @gabivlj! - Fix container egress interception on arm64 Docker runtimesBoth
wrangler devand the Cloudflare Vite plugin no longer force theproxy-everythingsidecar image to pull aslinux/amd64, allowing Docker to select the native image from the multi-platform manifest. SetMINIFLARE_CONTAINER_EGRESS_IMAGE_PLATFORMto force a specific platform when needed. -
Updated dependencies [
a085dec,9a0de8f,fab565f,3f02864,4ef872f,2a02858,e312dec]:
1.42.1
Patch Changes
-
#14366
c6579d3Thanks @jamesopstad! - Resolve relativecf-workerentrypoint imports relative to the importing moduleWhen loading the experimental
cloudflare.config.ts, a relative entrypoint imported withimport ... with { type: "cf-worker" }(e.g../src/index.ts) is now anchored to the module where the import is written, rather than being passed through verbatim and later resolved against the top-level config file. This fixes incorrect resolution when the import lives in a file other than the entry config — for example a config that re-exports from a nested file.Bare specifiers (such as
@scope/pkg) and virtual modules (such asvirtual:foo) are still left unresolved so that consumers can apply their own resolution. -
Updated dependencies [
c6579d3,444b75e,b38823f,cfd6205,cfd6205]:
1.42.0
Minor Changes
-
#14339
aa49856Thanks @jamesopstad! - Add abuildcommand to the experimental, internalcf-vitedelegate binarycf-vite buildruns Vite's full multi-environment app build (via the Builder API) and enables the experimental Build Output API by default, emitting a self-contained.cloudflare/output/v0/directory. It forcesexperimental.newConfigandexperimental.newConfig.cfBuildOutputon, so acloudflare.config.tsis required at the project root.
Patch Changes
-
#14346
e930bd4Thanks @haidargit! - Bumpwsfrom 8.20.1 to 8.21.0 to address GHSA-96hv-2xvq-fx4pGHSA-96hv-2xvq-fx4p / CVE-2026-48779 (high severity) reports a remote memory-exhaustion DoS in
ws@<8.21.0: a peer sending a high volume of tiny fragments and data chunks over modest network traffic can crash awsserver or client via OOM. The fix shipped in ws@8.21.0 (commit2b2abd45, released 2026-05-22), which also introduces themaxBufferedChunksandmaxFragmentsoptions. This change bumps the workspace catalog entry so thatminiflare,wrangler, and@cloudflare/vite-pluginall pick up the patched release. -
#14351
6c7df19Thanks @jamesopstad! - Force the experimental new config on by default in thecf-vite devdelegate -
#14218
4eed569Thanks @matingathani! - Allowresolve.externalcontaining only Node.js built-ins in Worker environmentsVitest 4 automatically sets
resolve.externalto the full list of Node.js built-in modules for non-standard Vite environments via its internalrunnerTransformplugin. Previously, the Cloudflare Vite plugin rejected any non-emptyresolve.externalarray, throwing an incompatibility error on startup when used alongside Vitest 4.The validation check now allows
resolve.externalarrays that contain only Node.js built-in module names (both barefsandnode:fsforms). The error is only thrown whenresolve.externalistrueor contains non-built-in package names that would prevent user code from being bundled into the Worker. -
Updated dependencies [
673b09e,e930bd4,f6e49dd,5c3bb11,296ad65,594544d,a79b899,5dfb788,ca61558,36777db]:
1.41.0
Minor Changes
-
#14279
e6e4b07Thanks @jamesopstad! - Addexperimental.newConfig.cfBuildOutputoption to support future deployments via thecfCLI// vite.config.ts import { defineConfig } from "vite"; import { cloudflare } from "@cloudflare/vite-plugin"; export default defineConfig({ plugins: [ cloudflare({ experimental: { newConfig: { cfBuildOutput: true, }, }, }), ], });
Patch Changes
- Updated dependencies [
0e055d3,27db82c,2a6a26b,9a424ed,ecfdd5a,604be26,1fb7ba5,208b3bb,41f391f,32f9307,8b2ce41,3578919,ee82c76,41f391f,21dbc12,7e63948,035917f]:
1.40.2
Patch Changes
-
#14184
e305126Thanks @penalosa! - Drop the--configflag from the experimental internalcf-vitedelegate binary.The wrangler config file is now discovered by
cloudflare()itself rather than being passed through, keepingcf-vite's flag surface (--mode,--port,--host,--local) in sync with the siblingcf-wranglerdelegate.cf-viteis an internal integration point spawned by Cloudflare tooling and is not intended to be run directly by users. -
Updated dependencies [
98c9afe,e305126,f3990b2,4597f08,25722ac,41f75c0,10b5538,818c105,2ae6099,2047a32,2047a32,e8561c2]:
1.40.1
Patch Changes
- Updated dependencies [
23aecac,b932e47,d076bcc,24497d0,4bb572f,165adb2,776098c,0706fbf,7993711,48c4ff0,8cf8c61,8923f97,b205fb7,a61ac29]:
1.40.0
Minor Changes
-
#14013
3cf9d0eThanks @jamesopstad! - Add experimentalexperimental.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.
Patch Changes
- Updated dependencies [
c6c61b5,c6c61b5,a3eea27,7a6b1a4,7539a9b,1fdd8de,3b8b80a,0bb2d55,8400fb9,b502d54,7949f81,d462013,c2280cd,3b8b80a,ea12b58,acf7817]:
1.39.2
Patch Changes
-
#13893
d8a16e7Thanks @penalosa! - Add an experimental, internalcf-vitedelegate binaryThis adds an experimental
bin/cf-vitebinary that is spawned by Cloudflare's own parent tooling to drive the plugin as a long-running dev-server subprocess. It is not part of the plugin's public API surface, is not intended to be invoked directly, and its contract may change at any time without notice. -
#14117
3c86121Thanks @aicayzer! - Forward response headers from the Worker on WebSocket upgrade responsesHeaders set on a
new Response(null, { status: 101, webSocket, headers })returned from the Worker are now propagated to the upgrade response sent to the browser duringvite dev. Previously the headers were dropped, so cookies (Set-Cookie) and custom headers (X-*) on WebSocket handshake responses were invisible client-side — even though they were delivered correctly bywrangler dev. -
Updated dependencies [
b210c5e,aec1bb8,e06cbb7,9a26191,5565823,4ef790b,890fca7,6fc9777,337e912,8e7b74f,e86489a,42288d4,65b5f9e,3a746ac,64ef9fd,94b29f7]:
1.39.1
Patch Changes
-
#14087
e3c862aThanks @edmundhung! - Filter compatibility date fallback warning when no update is availableThe compatibility date warning from workerd (e.g., "The latest compatibility date supported by the installed Cloudflare Workers Runtime is...") is now only shown when a newer version of
@cloudflare/vite-pluginis available. This matches the behavior in Wrangler and reduces noise when the user is already on the latest version.The update-check logic has been extracted to
@cloudflare/workers-utilsso it can be shared across packages. -
#14080
ec70cf1Thanks @edmundhung! - FixTunnel closedbeing logged when no tunnel was openedPreviously, the Vite plugin printed
Tunnel closedduring cleanup even when tunnel startup had never begun. This message is now only shown after tunnel startup begins, including when the tunnel is still starting or has already expired. -
Updated dependencies [
e3c862a,cbb39bd,cbb39bd,408432a,1103c07,7bb5c7a,5b5cbd3,e3c862a,e3c862a,97d7d81,c647ccc,e3c862a,e3c862a,e3c862a,e3c862a,e3c862a,b64b7e4,e3c862a,e3c862a,e4c8fd9,2dffeeb,e3c862a,e3c862a,4c0da7b,972d13d,13cbadb,59e43e4]:
1.39.0
Minor Changes
-
#13985
c809d30Thanks @jamesopstad! - AddassetsOnly(entry Worker) anddevOnly(auxiliary Workers) options to the plugin configBoth options accept a
booleanor a function that returns aboolean. The function is evaluated lazily at build time, allowing frameworks to provide the value after initialization.Use
assetsOnlyon the entry Worker to skip building the Worker and instead emit an assets-only Wrangler config to the client output directory. This enables frameworks such as Astro to use thessrenvironment during development but produce a fully static app for deployment.export default defineConfig({ plugins: [ cloudflare({ assetsOnly: () => isStaticBuild, }), ], });Use
devOnlyon an auxiliary Worker to include it duringvite devbut skip it at build time.export default defineConfig({ plugins: [ cloudflare({ auxiliaryWorkers: [ { configPath: "./dev-only-worker/wrangler.jsonc", devOnly: true }, ], }), ], });
Patch Changes
1.38.0
Minor Changes
-
#13989
f598eacThanks @MattieTK! - Print a QR code alongside the tunnel URL when sharing via Cloudflare TunnelWhen a tunnel is started (via
wrangler dev --tunnelor the Vite plugin withtunnel: true), a scannable QR code is now printed to the terminal beneath the tunnel URL. This makes it easy to open the tunnel on a mobile device without manually copying the URL.The QR code uses Unicode block characters for a compact representation and is generated best-effort -- if generation fails for any reason, the tunnel URL is still displayed as before.
Patch Changes
1.37.3
Patch Changes
-
#13978
fa1f61fThanks @sassyconsultingllc! - Bumpwsfrom 8.18.0 to 8.20.1 to address GHSA-58qx-3vcg-4xpxGHSA-58qx-3vcg-4xpx / CVE-2026-45736 reports an uninitialized-memory disclosure in
ws@<8.20.1when aTypedArrayis passed as the reason argument toWebSocket.close(). The fix shipped in ws@8.20.1 on 2026-05-12. This change bumps the workspace catalog entry so thatminiflare,wrangler, and@cloudflare/vite-pluginall pick up the patched release. -
#13912
d803737Thanks @petebacondarwin! - Fix/cdn-cgi/*host validation incorrectly accepting subdomains of exact configured routesMiniflare's
/cdn-cgi/*host/origin validator was treating exact configured routes the same as wildcard configured routes, so a request whoseHostorOriginhostname was a subdomain of an exact route (e.g.sub.my-custom-site.comfor amy-custom-site.com/*route) was incorrectly accepted. Exact configured routes and the configuredupstreamhostname are now required to match the request hostname exactly. Subdomain matching is only applied to wildcard routes such as*.example.com/*. Localhost hostnames continue to be allowed as before.This affects
wrangler devand local development through@cloudflare/vite-plugin, both of which use Miniflare under the hood. -
#13919
c7eab7fThanks @petebacondarwin! - Fix the outboundCF-Workerheader reflecting the route pattern hostname instead of the parent zone, and falling back to<worker-name>.example.comundervite dev,vitest-pool-workers, andgetPlatformProxyTwo related issues affected the
CF-Workerheader on outbound subrequests in local development:- Under
@cloudflare/vite-plugin,@cloudflare/vitest-pool-workers, andgetPlatformProxy, the header fell back to<worker-name>.example.comeven whenrouteswere configured, becauseunstable_getMiniflareWorkerOptionsand the equivalentgetPlatformProxyworker-options path did not propagate azonevalue to Miniflare. This broke local development against services that reject unknownCF-Workerhosts (for example, Apple WeatherKit returns403 Forbidden). - Across the above paths and
wrangler dev --local, when a route used thezone_namefield (for example{ pattern: "foo.example.com/*", zone_name: "example.com" }), the header was set to the pattern's hostname (foo.example.com) rather than the zone name (example.com). Production setsCF-Workerto the zone name that owns the Worker, so this was inconsistent with deployed behaviour.
Both bugs are fixed: the new
unstable_getMiniflareWorkerOptions/getPlatformProxypath now propagates azonederived from the first configured route, and all four local-dev paths now prefer a route's explicitzone_nameover the pattern hostname when computing that zone. Whenzone_nameisn't set, the existing best-effort behaviour is preserved — forwrangler devthis meansdev.hostis still honoured as a local override and the pattern hostname is used as a final fallback. Resolving the parent zone forzone_id-only,custom_domain, or plain-string routes would require an API lookup, so locally we still approximate it with the pattern hostname.Note:
dev.hostis intentionally not consulted by theunstable_getMiniflareWorkerOptions/getPlatformProxypaths — thedevconfig block is specific towrangler dev. - Under
-
Updated dependencies [
fa1f61f,2679e05,7e40d98,adc9221,735852d,d803737,c7eab7f,e04e180,59cd880,62abf97,e8c2031,e349fe0,da0fa8c,a5c9365]:
1.37.2
Patch Changes
-
#13098
67a881aThanks @raashish1601! - fix: route WebSocket upgrade requests directly to the user worker in dev mode -
Updated dependencies [
aac7ca0,b25dc0d,ae047ee,a4f22bc,f78d435,aac7ca0,c5c9e20,ebf4b24,b27eb18,895baf5,7bcdf45]:
1.37.1
Patch Changes
-
#13922
23800f8Thanks @edmundhung! - Add a tunnel shortcut hint when CLI shortcuts are printedThe Cloudflare Vite plugin now includes a
t + entertunnel hint alongside the other CLI shortcuts it prints. -
#13920
f579e57Thanks @petebacondarwin! - HonorX-Forwarded-Protowhen constructing the Worker'srequest.urlWhen running the Vite dev server behind a TLS-terminating reverse proxy or tunnel, the Worker's
request.urlwas alwayshttp://...even though the client reached the server overhttps://.... This caused frameworks that perform Origin/Host checks (e.g. CSRF protection) to reject requests with403.The Vite plugin now reads the
X-Forwarded-Protoheader from the incoming request and uses it to set the protocol ofrequest.url. If the header is absent or invalid, the connection protocol is used as before. The same handling is applied to WebSocket upgrade URLs.Fixes #13801.
-
Updated dependencies [
19ed49a,3ff0a50,bf688f7,2e72c83,802eaf4,506aa02,8f5cdb1,be8a98c]:
1.37.0
Minor Changes
-
#13903
7ce6f6fThanks @edmundhung! - Add named tunnel support to thecloudflare()Vite pluginYou can now expose your local dev server publicly with a stable hostname by configuring
tunnelwith a named Cloudflare Tunnel:cloudflare({ tunnel: { name: "my-tunnel", autoStart: true }, });If
autoStartis omitted or set tofalse, you can still start or close the tunnel by pressingt + enter.
Patch Changes
- Updated dependencies [
d4794a8,58b4403,4352f87,a9e6741,da664d5,bdc398c,f781a2b,1420f10,c8be316]:
1.36.4
Patch Changes
-
#13888
2af4ce0Thanks @jamesopstad! - Update Vite to v8.0.12This updates the bundled Vite module runner to include the bug fix in https://github.com/vitejs/vite/pull/22369.
-
Updated dependencies [
4e44ce6,b0cee1d,d878e13,971dfe3,971dfe3,5d936c5]:
1.36.3
Patch Changes
1.36.2
Patch Changes
1.36.1
Patch Changes
-
#13802
a7fd465Thanks @deodad! - Fix.dev.varswritten forvite previewto round-trip values containing quotesWhen the plugin emits
dist/<env>/.dev.varsforvite preview, it previously wrote each value as a double-quoted dotenv string with"escaped to\".dotenv(the parser wrangler uses) does not unescape\"inside double-quoted values, so values containing"arrived at the worker with literal backslashes still in them.The plugin now quotes strings using the first quote character that does not appear in the value (with the priority order: single → backtick → double), all of which dotenv strips correctly. If a value contains every supported quote character it throws instead of silently corrupting the value.
-
Updated dependencies [
2284f20,332f527,039bada,18e833d,b6cea17,1a54ac5,53e846a,f3fed88,beff19c,af42fed,1a54ac5]:
1.36.0
Minor Changes
-
#13810
2b8c0ccThanks @jamesopstad! - Stabilize thesecretsconfiguration propertyThe
secretsproperty in the Wrangler config file is no longer experimental and will no longer emit an experimental warning when used. Required secrets are validated during local development and deploy, and used as the source of truth for type generation.{ "secrets": { "required": ["API_KEY", "DB_PASSWORD"] } }
Patch Changes
-
#13814
a2f9c26Thanks @edmundhung! - Deny additional credential files from the Vite dev serverThe Cloudflare Vite plugin now adds
.npmrc,.yarnrc,.yarnrc.yml, and more certificate and key file extensions toserver.fs.deny. This prevents common credential files from being fetched directly during local development. -
Updated dependencies [
e07825a,58899d8,3020214,0099265,25f5ef2,bb27219,194d75e,12fb5db,18b9d5b,9f532f7,1127114,3ceadef,2b8c0cc,1a5cc86]:
1.35.0
Minor Changes
-
#13618
c07d0cbThanks @jamesopstad! - Support V2 protocol for module fallback serviceWhen the
new_module_registrycompatibility flag is set, requests sent tounsafeModuleFallbackService()use a different protocol. The Vite plugin now supports both protocols in its handling of additional module types.
Patch Changes
-
#13363
6457fb3Thanks @courtney-sims! - Prepares router-worker for a more gradual rollout by refactoring and separating out the invocation from the business logic. In the future, this will provide space for us to route requests to new versions of router-worker based on their plan, but should make no functional difference today. -
Updated dependencies [
22e1a61,00523c8,b5ac54b,e653edf,e1eff94,1c4d850,6d28037,9a1f014,e539008,0bf64a7,0827815,b04eedf,6457fb3,c07d0cb,e539008]:
1.34.0
Minor Changes
-
#13666
edcff69Thanks @edmundhung! - Addtunnel: trueto thecloudflare()Vite plugin for sharing your local dev and preview servers via Cloudflare Quick TunnelsYou can now expose your local dev server publicly by setting
tunnel: true:cloudflare({ tunnel: true, });You can also enable tunnel sharing dynamically using an environment variable:
cloudflare({ tunnel: process.env.ENABLE_DEV_TUNNEL === "true", });This starts a Cloudflare Quick Tunnel that gives you a random
*.trycloudflare.comURL to share. The tunnel stops automatically when the dev or preview session ends. Quick tunnels don't require a Cloudflare account or any configuration.A warning is shown when Server-Sent Events (SSE) responses are detected through the tunnel, since quick tunnels don't support SSE.
Patch Changes
- Updated dependencies [
ea943ff,21b87b2,62e9f2a,9eb9e69,2dc6175,0a5db08,033d6ec,ae8eae3,f2e2241,4f6ed93,ed2f4ec,ef24ff2,92bb8a5,6d27479,f2e2241,118027d,fcc491a,e6c437a,e867ac2]:
1.33.2
Patch Changes
-
#13636
1d54fb7Thanks @edmundhung! - Stop denyingvite.config.*files from Vite dev server accessThis allows projects to access
vite.config.*files during development when needed. -
#13653
48c61b6Thanks @jamesopstad! - Use the date that the plugin is built as the default compatibility date.When no compatibility date was set by the user, the plugin was falling back to the current date. This meant that the date could get ahead of the latest date supported by the installed version of workerd. We now populate the default compatibility date when the plugin is built. This means that it is updated with each release but then stays fixed.
-
#13634
f3cb2b2Thanks @jamesopstad! - Simplify/cdn-cgi/handlingWe now only add special handling for
/cdn-cgi/handler/*routes, so that trigger handlers are invoked on the User Worker. -
#13611
6e99febThanks @smaldd14! - Support Cloudflare-managed registry images in Vite plugin local devPreviously, using a
registry.cloudflare.comimage in acontainersbinding would crashvite devwith an unsupported error. The Vite plugin now configures the Cloudflare API client usingCLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_IDbefore pulling container images, matching the behavior ofwrangler dev. -
Updated dependencies [
5a2968a,5680287,3494842,7d728fb,df9319d,d5e3c57,3ceeec3,7567ef7,0a95061,2831b54,7fc50c1,377715d]:
1.33.1
Patch Changes
1.33.0
Minor Changes
- #12600
50bf819Thanks @penalosa! - Useworkerd's debug port to power cross-process service bindings, Durable Objects, and tail workers via the dev registry. This enables Durable Object RPC via the dev registry, and is an overall stability improvement.
Patch Changes
-
#13587
fdb32caThanks @vimtor! - Allow internal Wrangler config path overrides via env@cloudflare/vite-pluginnow checksCLOUDFLARE_VITE_WRANGLER_CONFIG_PATHwhenconfigPathis not set explicitly. This lets integrators provide generated Wrangler configs outside the project root without requiring users to threadconfigPaththrough framework config. -
Updated dependencies [
05f4443,4a9ba90,d8c895a,b35617b,7dc0433,8ca78bb,b6e1351,d8314c6,b35617b,7f50300,4fda685,be5e6a0,e456952,59eec63,50bf819,cc1413a,d0a9d1c,4eb1da9,8ca78bb,266c418,6d887db,5716d69]:
1.32.3
Patch Changes
-
#13427
c4deb1dThanks @edmundhung! - Harden file serving for Vite devThe Vite plugin now includes Wrangler config files, Vite config files, and
.wranglerstate files inserver.fs.denyso they cannot be fetched directly from the Vite dev server. -
Updated dependencies [
854d66c,6f63eaa,aef9825,eaaa728,58292f6,5e5bbc1,d5ff5a4,07a918c,89c7829,60565dd,6cbcdeb,90aee27]:
1.32.2
Patch Changes
- Updated dependencies [
9b2b6ba]:
1.32.1
Patch Changes
1.32.0
Minor Changes
-
#13137
1313275Thanks @emily-shen! - Addehotkey to open local explorer during devPress
eduringvite devto open the local explorer UI at/cdn-cgi/explorer, which allows you to inspect the state of your D1, R2, KV, DO and Workflow bindings.
Patch Changes
- Updated dependencies [
5338bb6,79fd529,28bc2be,4fd138b,bafb96b,c50cb5b,2589395,525a46b,5eff8c1,1313275]:
1.31.2
Patch Changes
1.31.1
Patch Changes
1.31.0
Minor Changes
-
#13011
b9b7e9dThanks @ruifigueira! - Add experimental headful browser rendering support for local developmentExperimental: This feature may be removed or changed without notice.
When developing locally with the Browser Rendering API, you can enable headful (visible) mode via the
X_BROWSER_HEADFULenvironment variable to see the browser while debugging:X_BROWSER_HEADFUL=true wrangler dev X_BROWSER_HEADFUL=true vite devNote: when using
@cloudflare/playwright, two Chrome windows may appear — the initial blank page and the one created bybrowser.newPage(). This is expected behavior due to how Playwright handles browser contexts via CDP. -
#13051
d5bffdeThanks @dario-piotrowicz! - UpdategetLocalWorkerdCompatibilityDateto return today's dateThe re-exported
getLocalWorkerdCompatibilityDatefunction from@cloudflare/vite-pluginpreviously resolved the workerd compatibility date by traversing the localminiflareinstallation, which was unreliable in some package manager setups. It now simply returns today's date. The function is also marked as deprecated — callers should just use today's date instead, for example like so:new Date().toISOString().slice(0, 10)
Patch Changes
-
#13125
f76652cThanks @kayluhb! - Fix SyntaxError when SSR-transformed module ends with a single-line commentWhen module code ends with a
//comment (e.g.//# sourceMappingURL=...preserved by vite-plus), the closing}of the async wrapper inrunInlinedModulewas absorbed into the comment, causingSyntaxError: Unexpected end of input. Adding a newline before the closing brace prevents this. -
#13188
110002cThanks @shulaoda! - Normalize the return value ofgetAssetsDirectory()withvite.normalizePath()to ensureassets.directoryin the outputwrangler.jsonalways uses forward slashes -
Updated dependencies [
9c4035b,5d29055,fb67a18,d5bffde,ab44870,48d83ca,b2f53ea,b9b7e9d,14e72eb,4dc94fd,b2f53ea,d5bffde,48d83ca]:
1.30.3
Patch Changes
-
#13111
f214760Thanks @dependabot! - Add missingconnectkey toWorkerEntrypointandDurableObjectkey lists in the runner workerThe
connectmethod was added to theWorkerEntrypointandDurableObjecttypes in workerd 1.20260329.1 but was missing from theWORKER_ENTRYPOINT_KEYSandDURABLE_OBJECT_KEYSarrays used for RPC property access in the Vite plugin runner worker. This caused the compile-time exhaustiveness check to fail with the updated workers-types. -
Updated dependencies [
ffbc268,9eff028,ed20a9b,f214760,746858a,9aad27f,1fc5518,b539dc7,9282493,a532eea,cd0e971,d4c6158,2565b1d]:
1.30.2
Patch Changes
-
#12953
80b093eThanks @jamesopstad! - FixCannot perform I/O on behalf of a different requesterrors for deferred dynamic importsConcurrent requests that loaded the same dynamic import were previously sharing the same promise to resolve it in a Worker context. We now ensure that all imports execute within a Durable Object's IoContext before the result is returned to the Worker.
-
Updated dependencies [
eeaa473,9fcdfca,bc24ec8,1faff35,0b4c21a,535582d,992f9a3,f4ea4ac,91b7f73,f6cdab2,53ed15a,ce65246,7a5be20,6b50bfa,0386553,9c5ebf5,53ed15a,53ed15a]:
1.30.1
Patch Changes
-
#12851
86a40f0Thanks @jamesopstad! - Fix a bug that prevented using subpath imports for additional module typesYou can now use subpath imports for additional module types (
.html,.txt,.sql,.bin,.wasm) by defining them in yourpackage.jsonimportsfield:// package.json { "imports": { "#templates/page": "./src/templates/page.html" } }import page from "#templates/page"; export default { fetch() { return new Response(page, { headers: { "Content-Type": "text/html" }, }); }, } satisfies ExportedHandler; -
Updated dependencies [
593c4db,b8f3309,451dae3,5aaaab2,5aaaab2,f8516dd,9c9fe30,379f2a2,c2e9163,6a6449e,9a1cf29,875da60]:
1.30.0
Minor Changes
-
#12848
ce48b77Thanks @emily-shen! - Enable local explorer by defaultThis ungates the local explorer, a UI that lets you inspect the state of D1, DO and KV resources locally by visiting
/cdn-cgi/explorerduring local development.Note: this feature is still experimental, and can be disabled by setting the env var
X_LOCAL_EXPLORER=false.
Patch Changes
-
#12942
4f7fd79Thanks @jamesopstad! - Avoid splicing into the middleware stack for Vite versions other than v6Previously, the plugin spliced its pre-middleware into the Vite middleware stack relative to
viteCachedTransformMiddleware. In Vite 8, this middleware can be omitted in some scenarios, which would cause the splice to fail. The plugin now registers pre-middleware usingserver.middlewares.use()directly, which places it in the correct position for Vite 7+. For Vite 6, the middleware is moved to the correct position in a post hook. -
Updated dependencies [
782df44,3c988e2,62545c9,d028ffb,cb71403,71ab981,3a1c149,7c3c6c6,ce48b77,8729f3d]:
1.29.1
Patch Changes
-
#12936
cff91ffThanks @jamesopstad! - Select the appropriatevite/module-runnerimplementation during dev based on the user's Vite versionThe plugin now builds against Vite 8 and ships two bundled copies of
vite/module-runner: one from Vite 8 and one from Vite 7.1.12 (the last version before a breaking change to the module runner in Vite 7.2.0). At dev server startup, the correct implementation is selected based on the user's installed Vite version. This is Vite 8's module runner for users on Vite >= 7.2.0, and the legacy module runner for users on older versions. -
Updated dependencies [
c9b3184,13df6c7,df0d112,81ee98e,c600ce0,f509d13,3b81fc6,0a7fef9]:
1.29.0
Minor Changes
-
#12885
12505c9Thanks @edmundhung! - Add Vite 8 to the supported peer dependency rangeThe package now lists Vite 8 in its peer dependency range, so installs with Vite 8 no longer show a peer dependency warning.
Patch Changes
-
#12859
876108aThanks @dario-piotrowicz! - Fix crash when plugins send HMR events before runner initializationPreviously, if another Vite plugin (such as
vite-plugin-vue-devtools) sent HMR events duringconfigureServerbefore the Cloudflare plugin had initialized its runner, the dev server would crash withAssertionError: The WebSocket is undefined. The environment's WebSocket send operations are now deferred until the runner is fully initialized, allowing early HMR events to be handled gracefully. -
Updated dependencies [
ade0aed,2b9a186,65f1092,7b0d8f5,351e1e1,2b9a186]:
1.28.0
Minor Changes
-
#12855
c2b76bcThanks @jamesopstad! - Support local explorer/cdn-cgi/routesThe local explorer UI can now be accessed at
/cdn-cgi/explorer.
Patch Changes
-
#12834
64edac7Thanks @jamesopstad! - Warn when theassetsfield is provided for auxiliary WorkersAuxiliary Workers do not support static assets. Previously, the
assetsfield was silently ignored but we now warn if it is used. -
#12794
b980af6Thanks @aron-cf! - Fix Sandbox SDK preview URL WebSocket routingWhen using Sandbox SDK preview URLs, WebSocket requests using the
vite-hmrprotocol could be dropped before they reached the worker, causing HMR to fail. The plugin now forwards Sandbox WebSocket traffic and preserves the original request origin/host so worker proxy logic receives the correct URL. -
Updated dependencies [
f7de0fd,ff543e3,8e89e85,e63539d,8d1e130,6ee18e1,ecc7f79,1dda1c8,4bb61b9]:
1.27.0
Minor Changes
-
#12826
de65c58Thanks @gabivlj! - Enable container egress interception in local dev without theexperimentalcompatibility flagContainer local development now always prepares the egress interceptor sidecar image needed for
interceptOutboundHttp(). This makes container-to-Worker interception available by default in Wrangler, Miniflare, and the Cloudflare Vite plugin.
Patch Changes
- Updated dependencies [
5451a7f,5451a7f,82cc2a8,3c67c2a,d645594,211d75d,6ed249b,9f93b54,de65c58,cb14820,a7c87d1,b8c33f5,e4d9510]:
1.26.1
Patch Changes
1.26.0
Minor Changes
-
#12649
35b2c56Thanks @gabivlj! - Add experimental support for containers to workers communication with interceptOutboundHttpThis feature is experimental and requires adding the "experimental" compatibility flag to your Wrangler configuration.
-
#12701
23a365aThanks @jamesopstad! - Add local dev validation for the experimentalsecretsconfiguration propertyWhen the new
secretsproperty is defined,wrangler devandvite devnow validate secrets declared insecrets.required. When required secrets are missing from.dev.varsor.env/process.env, a warning is logged listing the missing secret names.When
secretsis defined, only the keys listed insecrets.requiredare loaded. Additional keys in.dev.varsor.envare excluded. If you are not using.dev.vars, keys listed insecrets.requiredare loaded fromprocess.envas well as.env. TheCLOUDFLARE_INCLUDE_PROCESS_ENVenvironment variable is therefore not needed when using this feature.When
secretsis not defined, the existing behavior is unchanged.// wrangler.jsonc { "secrets": { "required": ["API_KEY", "DB_PASSWORD"] } }
Patch Changes
- Updated dependencies [
6a8aa5f,d672e2e,35b2c56,5f7aaf2,209b396,23a365a,596b8a0,00e729e,0769056,150ef7b,bf9cb3d]:
1.25.6
Patch Changes
-
#12673
a04f6f1Thanks @jamesopstad! - Move proxy shared secret to a constant that is reused across restarts. -
#12684
53025f9Thanks @jamesopstad! - Fix Miniflare being incorrectly disposed during rapid dev server restarts
1.25.5
Patch Changes
-
#12628
494ee7bThanks @Master-Hash! - Append Cloudflare defaults to existing.assetsignorefiles during build outputWhen a project includes a
PUBLIC_DIR/.assetsignore, the plugin now preserves those rules and appends the requiredwrangler.jsonand.dev.varsentries instead of replacing the file content.
1.25.4
Patch Changes
1.25.3
Patch Changes
1.25.2
Patch Changes
- Updated dependencies [
f239077,aaa7200,2f19a40,8723684,e2a6600,5f9f0b4,452cdc8,527e4f5,aa82c2b,0b17117,ca58062]:
1.25.1
Patch Changes
- Updated dependencies [
5a868a0,caf9b11,c58e81b,33a9a8f,8077c14,caf9b11,7d2355e,936187d,7ea69af,5cc7158,caf9b11,9a565d5,7f18183,39491f9,43c462a,c4c86f8,7d2355e,c9d0f9d,5cc7158,5cc7158,c9d0f9d]:
1.25.0
Minor Changes
-
#12535
bd06ad2Thanks @edmundhung! - Set{ serverHandler: false }automatically when using@vitejs/plugin-rscBy default,
@vitejs/plugin-rscadds dev and preview server middleware that imports the RSC entry in Node.js. This fails withcloudflare:*imports (ERR_UNSUPPORTED_ESM_URL_SCHEME) and is unnecessary since the Cloudflare plugin handles requests via workerd. Users no longer need to passrsc({ serverHandler: false })manually.
Patch Changes
-
#12521
a8183dbThanks @edmundhung! - AvoidThe WebSocket is undefinederror when frameworks create a child Vite server during buildReact Router creates a child Vite dev server during production builds to compile route files. This could previously cause an intermittent
The WebSocket is undefinedassertion error. -
Updated dependencies [
ad817dd,b900c5a,f7fa326,734792a,7aaa2a5,cc5ac22,62a8d48,84252b7,e5efa5d,d06ad09,10a1c4a,be9745f,d7b492c,122791d,8809411,1a9eddd,41e18aa]:
1.24.0
Minor Changes
-
#12446
1231a2eThanks @jamesopstad! - Inferupload_source_mapssetting in the output Worker config from thebuild.sourcemapsetting in the Vite config.If build.sourcemap is enabled for a Worker environment, as in the following example,
"upload_source_maps": truewill now automatically be added to the outputwrangler.jsonfile. This removes the need to additionally specify theupload_source_mapsproperty in the input Worker config.export default defineConfig({ environments: { my_worker: { build: { sourcemap: true, }, }, }, plugins: [cloudflare()], });Note that if
upload_source_mapsis set in the input Worker config, this value will take precedence. This makes it possible to generate source maps without uploading them.
Patch Changes
-
#12393
fd8b3e5Thanks @BlankParticle! - Provide proxy shared secret to Miniflare so that the Worker receives the original Host header -
Updated dependencies [
5d56487,2d90127,2acb277,c8dda16,e02b5f5,8ba1d11,555b32a,d636d6a,bf8df0c,e02b5f5,988dea9,1f1c3ce,62635a0,fd902aa,312b5eb,961705c,355c6da,bfd17cd,3388c84,ce9dc01,21ac7ab,937425c]:
1.23.1
Patch Changes
-
#12381
98283faThanks @jamesopstad! - Avoid collectingnodejs_compatwarnings during dependency optimization.Previously, a custom plugin was provided during dependency optimization to collect warnings when Node.js built-ins were imported and the
nodejs_compatflag was not enabled. Because optimized dependencies are cached, the warning was only displayed when dependencies changed. Additionally, it sometimes included false positives from dependencies that were no longer used. We now always externalize Node.js built-ins during dependency optimization and collect the warnings at runtime. This is more consistent with how warnings are collected for direct imports of Node.js built-ins. -
Updated dependencies [
ee9b81f,63f1adb,ba13de9,447daa3,fe3af35,bd4bb98,dab4bc9,83adb2c,18c0784]:
1.23.0
Minor Changes
-
#11697
67a4ab1Thanks @jamesopstad! - Addexperimental.prerenderWorkeroption to the plugin config.This enables configuring a dedicated Worker for prerendering at build time. This is an experimental feature and may change or be removed at any time.
-
#12214
4db3864Thanks @jamesopstad! - Use Hook Filters to optimize plugin performance with Vite 8. This skips unnecessary Rust-to-JS calls with Rolldown powered Vite.
Patch Changes
-
#12358
4340c42Thanks @jamesopstad! - Always emit a.assetsignorefile in the client output directory.Previously, we would emit a
.assetsignorefile in the client output directory only if the client output included awrangler.jsonfile. We now always emit it, which prevents awrangler.jsonfile being deployed as an asset if it is copied into this directory by mistake. -
Updated dependencies [
964a39d,253a85d,ce736b9,0c9625a,47944d1,4c4d5a5,b05b919,0aaf080,b981db5,a113c0d,fdd7a9f,a5fca2c,1bd1488,f7aa8c7]:
1.22.1
Patch Changes
-
#12187
0c85b05Thanks @jamesopstad! - UseesmExternalRequirePluginto convert externalrequirecalls in Vite 8. -
Updated dependencies [
8a210af,eb8a415,3b06b18,17961bb,52fdfe7,6d8d9cd,5f060c9,cb72c11]:
1.22.0
Minor Changes
- #12034
05714f8Thanks @emily-shen! - Add a no-op local explorer worker, which is gated by the experimental flagX_LOCAL_EXPLORER.
Patch Changes
-
#12052
9c76067Thanks @edmundhung! - Fix dev server crash on WebSocket client disconnectWhen a WebSocket client disconnects while an upgrade request is being processed, the server would crash with an unhandled
ECONNRESETerror. The fix adds an error handler to the socket at the start of the upgrade process. -
Updated dependencies [
a0a9ef6,ad4666c,014e7aa,e414f05,77e82d2,f08ef21,0641e6c,eacedba,05714f8,e8b2ef5,bbd8a5e]:
1.21.2
Patch Changes
-
#11875
ae2459cThanks @bxff! - Skip shortcut registration in non-TTY environmentsPreviously, registering keyboard shortcuts in non-TTY environments (e.g., Turborepo) caused Miniflare
ERR_DISPOSEDerrors during prerendering. Shortcuts are now only registered when running in an interactive terminal. -
Updated dependencies [
614bbd7,788bf78,1375577,ae108f0,bba0968,c3407ad,f9e8a45]:
1.21.1
Patch Changes
-
#11951
77fdc18Thanks @jamesopstad! - Add validation for environment name collisions and improve error message for missing environments. -
Updated dependencies [
75386b1,8e4a0e5,133bf95,93d8d78,69ff962,22727c2,fa39a73,4ac7c82,69ff962,029531a,d58fbd1,202c59e,133bf95,25e2c60,69ff962]:
1.21.0
Minor Changes
-
#11879
5c8ff05Thanks @jamesopstad! - Add support for child environments.This is to support React Server Components via @vitejs/plugin-rsc and frameworks that build on top of it. A
childEnvironmentsoption is now added to the plugin config to enable using multiple environments within a single Worker. The parent environment can import modules from a child environment in order to access a separate module graph. For a typical RSC use case, the plugin might be configured as in the following example:export default defineConfig({ plugins: [ cloudflare({ viteEnvironment: { name: "rsc", childEnvironments: ["ssr"], }, }), ], });
Patch Changes
-
#11898
c17e971Thanks @petebacondarwin! - Bundle more third-party dependencies to reduce supply chain riskPreviously, several small utility packages were listed as runtime dependencies and installed separately. These are now bundled directly into the published packages, reducing the number of external dependencies users need to trust.
Bundled dependencies:
- miniflare:
acorn,acorn-walk,exit-hook,glob-to-regexp,stoppable - kv-asset-handler:
mime - vite-plugin-cloudflare:
@remix-run/node-fetch-server,defu,get-port,picocolors,tinyglobby - vitest-pool-workers:
birpc,devalue,get-port,semver
- miniflare:
-
Updated dependencies [
e78186d,fe4faa3,fec8f5b,d39777f,4714ca1,c17e971,695b043]:
1.20.3
Patch Changes
- Updated dependencies [
99b1f32]:
1.20.2
Patch Changes
-
#11834
5c59217Thanks @vicb! - fix handling of Node builtin modulesThe list of builtin modules should not depend on the version of Node. Switch to using the lists published by
@cloudflare/unenv-preset.This fixes an issue with trying to import i.e.
node:sqlitewith Node < 22.5.0 which does not implement this module. -
#11838
88a9e20Thanks @jamesopstad! - Setbuild.rolldownOptions.resolve.extensionsfor compatibility with Vite 8 beta. -
#11847
46e09a6Thanks @jamesopstad! - Applyvite-plugin-cloudflare:nodejs-compat-warningsplugin only to relevant environments.This is an optimisation so that it doesn't run for the
clientenvironment or Worker environments that have thenodejs_compatcompatibility flag enabled. -
Updated dependencies [
b0e54b2,ed60c4f,5c59217,faa5753,e574ef3,b6148ed,beb96af,5c59217,ab3859c,0eb973d,ad65efa,fc96e5f,43d5363,0f8d69d]:- wrangler@4.59.0
- miniflare@4.20260111.0
- @cloudflare/unenv-preset@2.9.0
1.20.1
Patch Changes
-
#11807
fada563Thanks @jamesopstad! - UserolldownOptionsin plugin config when available.This improves compatibility with Vite 8 beta and removes warnings related to use of
esbuildOptions.
1.20.0
Minor Changes
-
#11620
25f6672Thanks @dario-piotrowicz! - Expose a newgetLocalWorkerdCompatibilityDateutility that allows callers to get the compatibility date of the locally installedworkerdpackage. -
#11723
3455912Thanks @jamesopstad! - Add a postbuildApphook that builds Worker environments that haven't already been built.This ensures that auxiliary Workers are included in the build when using full-stack frameworks that define their own
builder.buildAppfunction. Note that this feature is not supported with Vite 6 as thebuildApphook was introduced in Vite 7. -
#11738
c54f8daThanks @jamesopstad! - Add defaultTextmodule rule for.sqlfiles.This enables importing
.sqlfiles directly in Wrangler and the Cloudflare Vite plugin without extra configuration.
Patch Changes
-
#11815
70ef3edThanks @jamesopstad! - SetignoreOutdatedRequeststotrueinoptimizeDepsconfig.This is a workaround for https://github.com/vitejs/vite/issues/20867 and will resolve
Error: There is a new version of the pre-bundle for ...errors that some users are experiencing. The longer term solution is to use full-bundle mode rather thanoptimizeDepsonce it is supported for server environments. Vite v7.3.1 or above is needed for this change to take effect. -
#11735
dd66dcdThanks @jamesopstad! - RemovetopLevelNameandnamewhen passingentryWorkerConfigto theconfigfunction for auxiliary Workers.The
namefor each Worker should be unique and thetopLevelNameis computed rather than provided directly. -
#11720
0457de6Thanks @jamesopstad! - fix: regression where plain class and object types were no longer supported as Durable Objects and Worker entrypoints -
Updated dependencies [
02fbd22,b993d95,f612b46,77078ef,2510723,65d1850,1615fce,b2769bf,554a4df,9f6dd71,8eede3f,d123ad0,9e360f6,5121b23,82e7e90,6a05b1c,62fd118,a7e9f80,fc95831,b0dbf1a,4688f59,69979a3,c54f8da,df1f9c9,d059f69,eac5cf7,b827893]:- wrangler@4.57.0
- miniflare@4.20260103.0
- @cloudflare/unenv-preset@2.8.0
1.19.0
Minor Changes
-
#11670
3483b84Thanks @jamesopstad! - Provide the resolved entry Worker config in the second parameter to the auxiliary Workerconfigfunction. This makes it straightforward to inherit configuration from the entry Worker in auxiliary Workers.Example:
export default defineConfig({ plugins: [ cloudflare({ auxiliaryWorkers: [ { config: (_, { entryWorkerConfig }) => ({ name: "auxiliary-worker", main: "./src/auxiliary-worker.ts", // Inherit compatibility settings from entry Worker compatibility_date: entryWorkerConfig.compatibility_date, compatibility_flags: entryWorkerConfig.compatibility_flags, }), }, ], }), ], });
Patch Changes
1.18.0
Minor Changes
-
#11045
12a63efThanks @edmundhung! - Add keyboard shortcut to display Worker bindings during developmentWhen running
vite devorvite preview, you can now pressb + Enterto display a list of all bindings configured for your Worker(s). This makes it easier to discover and verify which resources (e.g. KV namespaces, Durable Objects, environment variables, etc.) are available to your Worker during development.This feature requires
viteversion7.2.7or later. -
#11265
06f48c0Thanks @petebacondarwin! - Add a check to vite-plugin that ensures that the version of Wrangler being used internally is correctIn some pnpm setups it is possible for a different peer dependency version of Wrangler to leak and override the version that we require internally.
Patch Changes
- Updated dependencies [
ed42010,5d085fb,b75b710,1e9be12,6b28de1,6c590a0,12a63ef,4201472,7d8d4a6,95d81e1,6c590a0]:
1.17.1
Patch Changes
- Updated dependencies [
c15e99e,31c162a,bd5f087,c6dd86f,235d325,b17797c,b17797c,41103f5,ea6fbec,bb47e20,991760d]:
1.17.0
Minor Changes
Patch Changes
-
#11466
4f15699Thanks @ascorbic! - Throw a more helpful error message when a Worker's entry module can't be resolved -
Updated dependencies [
819e287,af54c63,9988cc9,ce295bf,45480b1,9514c9a,94c67e8,ac861f8,79d30d4,56e78c8,0aa959a,f550b62]:- @cloudflare/unenv-preset@2.7.13
- wrangler@4.53.0
- miniflare@4.20251202.1
1.16.1
Patch Changes
1.16.0
Minor Changes
-
#11445
c8e22c3Thanks @ascorbic! - Allow Worker config to be customized in the plugin configThe 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"; }, }), ], }); -
#11360
6b38532Thanks @emily-shen! - Containers: Allow users to directly authenticate external image registries in local devPreviously, 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.
-
#11408
f29e699Thanks @ascorbic! - Support zero-config operationIf 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.
-
#11417
2ca70b1Thanks @jamesopstad! - 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
-
#11383
1d685cbThanks @dario-piotrowicz! - Fix: Ensure thatvite 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.
-
#11009
e4ddbc2Thanks @dario-piotrowicz! - Make sure that theaccount_idpresent in the user's config file is used for remote bindings -
Updated dependencies [
2b4813b,abe49d8,b154de2,f29e699,5ee3780,6e63b57,71ab562,76f0540,2342d2f,5e937c1,9a1de61,6b38532,e4ddbc2,2aec2b4,695fa25,504e258,5a873bb,d25f7e2,1cfae2d,e7b690b,1d685cb,edf896d,2b4813b,c47ad11,a977701,9eaa9e2]:- miniflare@4.20251128.0
- wrangler@4.52.0
- @cloudflare/unenv-preset@2.7.12
1.15.3
Patch Changes
-
#11404
f19d3b5Thanks @jamesopstad! - fix: CSS imports in Worker modules causing dev server to crash when starting up -
Updated dependencies [
69f4dc3,1133c4d,4d61fae,d524e55,43903a3,e496280]:
1.15.2
Patch Changes
-
#11342
a55c0e4Thanks @jamesopstad! - fix:emailmethod not working in ExportedHandler exports in development -
#11322
49eada3Thanks @jamesopstad! - Addcloudflare:nodeto built-in modules -
Updated dependencies [
0cf696d,524a6e5,c922a81,bb44120,4a158e9]:- @cloudflare/unenv-preset@2.7.11
- wrangler@4.50.0
- miniflare@4.20251118.1
1.15.1
Patch Changes
-
#11331
52ebfa9Thanks @edmundhung! - Dispose Miniflare when preview server is closed
1.15.0
Minor Changes
- #11238
da8442fThanks @jamesopstad! - Add support forctx.exports. See https://developers.cloudflare.com/workers/runtime-apis/context/#exports for more details.
Patch Changes
-
#11274
fa39c78Thanks @jamesopstad! - Ensure process.on("exit") handlers are only added once. -
#11273
17431dbThanks @jamesopstad! - Ensure static routing exclude rules for static assets are only evaluated once per request in development. -
Updated dependencies [
c5c4ee5,d0041e2,827d017,7035804,a352c7f,8e99766,d0d3fe6,d014fa7,92afbba,65b4afe,da8442f,15b8460,09cb720,793e2b4,8e99766,9cbf126,2011b6a,dd1e560]:
1.14.2
Patch Changes
1.14.1
Patch Changes
- Updated dependencies [
5286309,2d16610,dd7d584,4259256,63defa2,5cf8a39,70d3d4a,38396ed,8abc789,cdcecfc,e85f965,88aa707]:- wrangler@4.47.0
- miniflare@4.20251109.0
- @cloudflare/unenv-preset@2.7.10
1.14.0
Minor Changes
- #11162
c3ed531Thanks @dario-piotrowicz! - add aremoteBindingsoption to allow the disabling of remote bindings
Patch Changes
- Updated dependencies [
240ebeb,05440a1,1ae020d,53b0fce,c3ed531,305d7bf,b55a3c7,c3ed531,5d7c4c2,c3ed531]:
1.13.19
Patch Changes
-
#11123
9c5601aThanks @sapphi-red! - Fix Vite 7.2 compatibility. -
#11137
c2a63abThanks @jamesopstad! - Switch all instances ofminiflare.getWorker()followed byworker.fetch()to useminiflare.dispatchFetch(). This means that the Vite plugin now emulates Cloudflare's response encoding in the same way as Wrangler. -
Updated dependencies [
8ffbd17,77ed7e2,bb00f9d,90a2566,ed666a1,14f60e8,22f25fd]:- wrangler@4.45.4
- @cloudflare/unenv-preset@2.7.9
- miniflare@4.20251011.2
1.13.18
Patch Changes
1.13.17
Patch Changes
1.13.16
Patch Changes
1.13.15
Patch Changes
-
#10741
2f57345Thanks @penalosa! - Remove obsolete--x-remote-bindingsflag -
Updated dependencies [
4bd4c29,31e1330,1a8088a,ca6c010,2f57345]:
1.13.14
Patch Changes
-
#10707
092c999Thanks @edmundhung! - Add request cancellation supportWorkers running on Vite can now listen to the abort event with
request.signalto perform tasks when the request is canceled by the client. For more information, see the Request documentation. -
#10768
8211bc9Thanks @dario-piotrowicz! - Ensure that logs are printed at the correct log levelThe changes here ensure that logs generated by Workers are printed accordingly to the
logLevelthe user defines (either in their Vite config file or via the--logLevelCLI flag) -
#10899
e2809b5Thanks @edmundhung! - fix: track server restart in module scopeWhen using
@cloudflare/vite-pluginwith React Router, miniflare might be disposed during restart. This change makes sure to track when the dev server restart in module scope to avoid unexpected behavior. -
Updated dependencies [
5124818,d4b4c90,6643bd4,1a2bbf8,36d7054,0ee1a68,8211bc9,3bb034f,43503c7,dd5f769,a6de9db,ee7d710,d39c8b5,7d0417b,8211bc9]:- wrangler@4.44.0
- miniflare@4.20251011.0
- @cloudflare/unenv-preset@2.7.8
1.13.13
Patch Changes
1.13.12
Patch Changes
1.13.11
Patch Changes
-
#10866
f62d0b6Thanks @jamesopstad! - Use tsdown to bundle the package. -
#10887
0de7511Thanks @jamesopstad! - Preserve the originalx-forwarded-hostheader if it is set. -
Updated dependencies [
51f9dc1,26adce7,196ccbf,f29b0b0,1334102]:- miniflare@4.20251004.0
- wrangler@4.42.1
- @cloudflare/unenv-preset@2.7.7
1.13.10
Patch Changes
-
#10825
4c509ecThanks @penalosa! - Support containers defined for Vite auxiliary Workers -
Updated dependencies [
103fbf0,2594130,59d5911]:- wrangler@4.42.0
- @cloudflare/unenv-preset@2.7.6
1.13.9
Patch Changes
-
#10673
bffd2a9Thanks @jamesopstad! - Only forward/cdn-cgi/handler/routes to trigger handlers. -
Updated dependencies [
4c06766,21a0bef,d3aee31,c8d5282,59e8ef0,79a6b7d,7a4d0da,bffd2a9,62656bd,886e577,7f2386e,8d7f32e,f9d37db,835d6f7,79a6b7d]:
1.13.8
Patch Changes
-
#10593
2ff7e6dThanks @BlankParticle! - fix: restore original url before passing request to miniflare in vite dev -
#10774
ed04ed3Thanks @dario-piotrowicz! - fix vite plugin not working when projects are in a path that contains a non-ascii character -
Updated dependencies [
ff82d80,7a6381c,6ff41a6,0c208e1,2432022,d0801b1,325d22e,8d07576,0a554f9,6244a9e,d09cab3]:- wrangler@4.40.3
- miniflare@4.20250927.0
- @cloudflare/unenv-preset@2.7.5
1.13.7
Patch Changes
- Updated dependencies [
b455281]:
1.13.6
Patch Changes
- Updated dependencies [
a57149f]:
1.13.5
Patch Changes
1.13.4
Patch Changes
-
#10677
d7aa0aeThanks @edmundhung! - Support Hyperdrive local connection strings from.envfilesYou can now define your Hyperdrive local connection string in a
.envfile using theCLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME>variable.CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_PROD_DB="postgres://user:password@127.0.0.1:5432/testdb" -
Updated dependencies [
555a6da,262393a,3ec1f65,a434352,328e687,97a72cc,b4a4311,dc1d0d6,acd48ed,55a10a3]:
1.13.3
Patch Changes
-
#10664
924fddeThanks @jamesopstad! - Avoid mutating the Worker config during build. -
Updated dependencies [
b59e3e1,a4e2439,1cc258e,f76da43,b30263e,b30263e,769ffb1,e9b0c66,6caf938,88132bc]:- miniflare@4.20250917.0
- wrangler@4.38.0
- @cloudflare/unenv-preset@2.7.4
1.13.2
Patch Changes
-
#10632
60631d5Thanks @jamesopstad! - Ensure that correct error messages and stack traces are displayed.
1.13.1
Patch Changes
1.13.0
Minor Changes
-
#10212
0837a8dThanks @jamesopstad! - Support packages and virtual modules in themainfield of the Worker config. The primary use case is to enable users to directly provide a file exported by a framework as the Worker entry module. -
#10604
135e066Thanks @penalosa! - Enable Remote Bindings without the need for theexperimental: { remoteBindings: true }property
Patch Changes
- Updated dependencies [
0837a8d,da24079,ffa2600,135e066,e2b838f,30f558e,d8860ac,336a75d,51553ef]:
1.12.4
Patch Changes
-
#10534
dceb550Thanks @dario-piotrowicz! - Ensure that preview config values are used for remote bindingsEnsure that if in some remote binding configuration provides a preview value (e.g.
preview_database_idfor D1 bindings) such value gets used instead of the standard ones -
Updated dependencies [
dac302c,4e49d3e,dceb550,3b78839,5cb806f]:- miniflare@4.20250906.0
- wrangler@4.35.0
- @cloudflare/unenv-preset@2.7.3
1.12.3
Patch Changes
-
#10544
4c80c78Thanks @jamesopstad! - SetpreserveEntrySignatures: "strict"for Worker environments. This ensures that no additional exports are added to the entry module. -
#10527
818ce22Thanks @vicb! - Bumpunenvto 2.0.0-rc.20The latest release include a fix for
node:ttydefault export. See the changelog for full details. -
Updated dependencies [
6e8dd80,4cb3370,7211609,818ce22,5d69df4,5d69df4,c22acc6,cb22f5f,cc47b51,c0fad5f,c6a39f5,a565291]:- wrangler@4.34.0
- miniflare@4.20250902.0
- @cloudflare/unenv-preset@2.7.2
1.12.2
Patch Changes
- Updated dependencies [
31ecfeb,f656d1a,22c8ae6,bd21fc5,3c15bbb,dc81221,38bdb78,4851955,4492eb0]:- @cloudflare/unenv-preset@2.7.1
- miniflare@4.20250829.0
- wrangler@4.33.2
1.12.1
Patch Changes
-
#10482
aec77ccThanks @jamesopstad! - Pass thecompatibility_dateandcompatibility_flagsto theunenvpreset. This enables support for thenode:httpandnode:httpsmodules. -
Updated dependencies [
76d9aa2,85be2b6,452ad0b,7c339ae]:- @cloudflare/unenv-preset@2.7.0
- wrangler@4.33.1
- miniflare@4.20250823.1
1.12.0
Minor Changes
- #10416
7b05c8eThanks @CarmenPopoviciu! - Add support for testing Cron Triggers and Email Workers invite devandvite preview.
Patch Changes
-
#10422
88fd2f9Thanks @jamesopstad! - Statically replace the value ofprocess.env.NODE_ENVin development when thenodejs_compatcompatibility flag is enabled. Previously, this was replaced at build time whennodejs_compatwas enabled and at dev and build time whennodejs_compatwas not enabled. -
#10065
3024ec1Thanks @MichaelDeBoey! - Update@mjackson/node-fetch-serverto@remix-run/node-fetch-server -
Updated dependencies [
c4fd176,19e2aab,c4fd176,e81c2cf]:- wrangler@4.33.0
- @cloudflare/unenv-preset@2.6.3
- miniflare@4.20250823.0
1.11.7
Patch Changes
- #10415
718fffcThanks @jamesopstad! - Exclude Cloudflare built-ins from client dependency optimization. Some frameworks allow users to mix client and server code in the same file and then extract the server code. As the dependency optimization may happen before the server code is extracted, we now exclude Cloudflare built-ins from client optimization. - Updated dependencies [
d304055,f534c0d,da40571,0a96e69,f9f7519,4728c68]:
1.11.6
Patch Changes
- Updated dependencies [
565c3a3,ddadb93,9b09751,cadf19a,20520fa,875197a]:- miniflare@4.20250816.0
- wrangler@4.31.0
- @cloudflare/unenv-preset@2.6.2
1.11.5
Patch Changes
- Updated dependencies [
76a6701,d54d8b7,979984b,80e964c,a5a1426,ae0c806,0c04da9,b524a6f,eb32a3a,4288a61]:
1.11.4
Patch Changes
- Updated dependencies [
5020694]:
1.11.3
Patch Changes
- Updated dependencies [
e7cae16,3b6ab8a,c58a05c,42aafa3,70bd966,d391076,422ae22,1479fd0,80960b9,05c5b28,5d5ecd5,e3d9703,bd8223d,e7cae16,d481901,9aad334,28494f4,8cf47f9]:- wrangler@4.29.0
- miniflare@4.20250803.1
- @cloudflare/unenv-preset@2.6.1
1.11.2
Patch Changes
1.11.1
Patch Changes
-
#9993
9901788Thanks @jamesopstad! - Fix issue that resulted inA hanging Promise was cancelederrors when developing large applications. We now handle requests for modules in a Durable Object so that they can be shared across invocations.Additionally, using
import.meta.hot.sendwithin the context of a request is now supported. -
#9556
8ba7736Thanks @edmundhung! - fix: cross-process service bindings no longer skip static asset serving -
#10099
360004dThanks @emily-shen! - fix: move local dev container cleanup to process exit hook. This should ensure containers are cleaned up even when Wrangler is shut down programatically. -
#10173
4e62cd8Thanks @jamesopstad! - Ensure that headers set viaserver.headersin the Vite config are added to HTML asset responses in development. -
Updated dependencies [
6b9cd5b,b4d1373,631f26d,d6ecd05,b4d1373,360004d,e82aa19,dae1377,8ba7736,1655bec,354a001,5c3b83f,502a8e0,07c8611,7e204a9,3f83ac1]:- @cloudflare/unenv-preset@2.6.0
- wrangler@4.28.0
- miniflare@4.20250803.0
1.11.0
Minor Changes
-
#9914
a24c9d8Thanks @petebacondarwin! - Add support for loading local dev vars from .env filesIf there are no
.dev.varsor.dev.vars.<environment>files, when running Wrangler or the Vite plugin in local development mode, they will now try to load additional local dev vars from.env,.env.local,.env.<environment>and.env.<environment>.localfiles.These loaded vars are only for local development and have no effect in production to the vars in a deployed Worker. Wrangler and Vite will continue to load
.envfiles in order to configure themselves as a tool.Further details:
- In
vite buildthe local vars will be computed and stored in a.dev.varsfile next to the compiled Worker code, so thatvite previewcan use them. - The
wrangler typescommand will similarly read the.envfiles (if no.dev.varsfiles) in order to generate theEnvinterface. - If the
CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENVenvironment variable is"false"then local dev variables will not be loaded from.envfiles. - If the
CLOUDFLARE_INCLUDE_PROCESS_ENVenvironment variable is"true"then all the environment variables found onprocess.envwill be included as local dev vars. - Wrangler (but not Vite plugin) also now supports the
--env-file=<path/to/dotenv/file>global CLI option. This affects both loading.envto configure Wrangler the tool as well as loading local dev vars.
- In
Patch Changes
-
#10071
4a4049cThanks @CarmenPopoviciu! - feat(vite-plugin): Add Containers-related info logsAdd logs, when a Worker has Containers configured, providing information about container build status, and how to rebuild containers during local development.
1.10.2
Patch Changes
-
#10048
dbdbb8cThanks @vicb! - pass the compatibility date and flags to the unenv preset -
#10040
26ffa05Thanks @CarmenPopoviciu! - feat(vite-plugin): Add containers support invite previewAdds support for Cloudflare Containers in
vite preview. Please note that at the time of this PR a container image can only specify the path to aDockerfile. Support for registry links will be added in a later version. -
#10054
bc910f9Thanks @eltigerchino! - Addworkerto the default conditions for resolving packagesThis makes it consistent with the conditions used when bundling Worker code with Wrangler.
-
#10061
f8a80a8Thanks @emily-shen! - fix: properly set the socket path that the container engine is listening on.Previously, this was only picking up the value set in Wrangler config under
dev.containerEngine, but this value can also be set from env vars or automatically read from the current docker context. -
Updated dependencies [
82a5b2e,f8f7352,2df1d06,f8a80a8,dbdbb8c,5991a9c,687655f,755a249]:- miniflare@4.20250726.0
- wrangler@4.26.1
- @cloudflare/unenv-preset@2.5.0
1.10.1
Patch Changes
-
#10031
823cba8Thanks @vicb! - wrangler and vite-plugin now depend upon the latest version of unenv-preset -
Updated dependencies [
c5b291d,3d4f946,7245101,823cba8,19794bf,154acf7,19794bf,7fb0bfd,059a39e]:- wrangler@4.26.0
- @cloudflare/unenv-preset@2.4.1
- miniflare@4.20250712.2
1.10.0
Minor Changes
-
#10001
5796ca9Thanks @jamesopstad! - We now automatically inject the following HMR code into your Worker entry file:if (import.meta.hot) { import.meta.hot.accept(); }This prevents file changes from invalidating the full module graph and improves HMR performance in development.
Patch Changes
-
#10038
a355327Thanks @emily-shen! - Resolvecontainers.image(if it is a path to a Dockerfile) to an absolute path in the deploy config. -
#9891
dd416e9Thanks @hi-ogawa! - setbuild.rollupOptions.platform: "neutral"on rolldown-vite to prevent Rolldown'snode:modulebasedrequirepolyfill from breaking the build. -
#9819
0c4008cThanks @CarmenPopoviciu! - feat(vite-plugin): Add containers support invite devAdds support for Cloudflare Containers in
vite dev. Please note that at the time of this PR a container image can only specify the path to aDockerfile. Support for registry links will be added in a later version, as will containers support invite preview. -
Updated dependencies [
189fe23,c02b067,7e5585d,b0217f9,e87198a,ad02ad3,0c4008c]:- @cloudflare/unenv-preset@2.4.0
- wrangler@4.25.1
- miniflare@4.20250712.1
1.9.6
Patch Changes
1.9.5
Patch Changes
-
Updated dependencies [
ac08e68,4ba9f25,17b1e5a,3bb69fa,274a826,77d1cb2,d6a1b9b,e2672c5,a5d7b35,5b0fc9e,bf4c9ab,14ce577,f73da0d]:
1.9.4
Patch Changes
1.9.3
Patch Changes
- Updated dependencies [
80cc834]:
1.9.2
Patch Changes
1.9.1
Patch Changes
-
#9856
8bf60a7Thanks @jamesopstad! - Set the Wrangler peer dependency to the same version as the direct dependency. This fixes an issue where older versions of Wrangler could override the version used by the plugin. -
Updated dependencies [
1b3a2b7,dbfa4ef,ba69586,1a75f85,395f36d,6f344bf,fc29c31,45497ab,a447d67,7c55f9e,49c85c5,0bb619a,a1181bf,a727db3,1358034,1a58bc3,7e3aa1b]:
1.9.0
Minor Changes
-
#9535
56dc5c4Thanks @penalosa! - In 2023 we announced breakpoint debugging support for Workers, which meant that you could easily debug your Worker code in Wrangler's built-in devtools (accessible via the[d]hotkey) as well as multiple other devtools clients, including VSCode. For most developers, breakpoint debugging via VSCode is the most natural flow, but until now it's required manually configuring alaunch.jsonfile, runningwrangler dev, and connecting via VSCode's built-in debugger.Now, using VSCode's built-in JavaScript Debug Terminals, there are just two steps: open a JS debug terminal and run
vite devorvite preview. VSCode will automatically connect to your running Worker (even if you're running multiple Workers at once!) and start a debugging session. -
#9803
df04528Thanks @penalosa! - Support Workers Analytics Engine & Rate Limiting bindings
Patch Changes
1.8.0
Minor Changes
-
#9773
45e97e8Thanks @jamesopstad! - Vite 7 is now supported and included as a peer dependency. We continue to also support Vite 6. -
#9753
67130b3Thanks @jamesopstad! - AllowoptimizeDeps.excludeto be specified for Worker environments. This enables other plugins to exclude dependencies from optimization that require access to virtual modules. Note that excluded dependencies must be ESM.
1.7.5
Patch Changes
1.7.4
Patch Changes
1.7.3
Patch Changes
-
#9647
6c6afbdThanks @jamesopstad! - In Vite 7, theapplyToEnvironmenthook is called in preview mode. This is now accounted for to ensure compatibility. -
Updated dependencies [
ffa742f,8a60fe7,c489a44,8a60fe7,17d23d8]:
1.7.2
Patch Changes
-
#9586
d1d34feThanks @penalosa! - Remove the Mixed Mode naming in favour of "remote bindings"/"remote proxy"
1.7.1
Patch Changes
1.7.0
Minor Changes
-
#9575
5601fc3Thanks @jamesopstad! - Supportrun_worker_first.run_worker_firsthas been expanded to accept an array of routes that should go directly to your Worker. Additionally, routes can be omitted by adding a!prefix. These negative routes will be treated as assets.This is a new way to define routing explicitly and, when provided, overrides the implicit routing behavior.
{ "assets": { "not_found_handling": "single-page-application", "run_worker_first": [ "/api/*", // These routes go directly to the Worker "!/api/docs/*" // These routes are still treated as assets ] } }The previous behavior of setting
"run_worker_first": trueto always invoke your Worker is also now supported.
Patch Changes
-
#9583
70ba9fbThanks @edmundhung! - fix: avoid crashing on unknown service bindings at startupWith Dev Registry support, the plugin no longer throws an assertion error during startup when a service binding references a named entrypoint from an unknown worker. Instead, an appropriate runtime error will be returned if the worker cannot be resolved.
-
#9548
0174e39Thanks @jamesopstad! - Enable HTML handling for HTML files in the public directory.It is generally encouraged to use HTML files as entry points in Vite so that their dependencies are bundled. However, if you have plain HTML files that should simply be copied to the root of the output directory as-is, you can place these in the public directory and they will now work as expected in dev.
-
#9566
521eeb9Thanks @vicb! - Bump@cloudflare/unenv-presetto 2.3.3 -
#9581
6bc0a2fThanks @petebacondarwin! - fix: ensure that globals are polyfilled before every import -
#9536
3b61c41Thanks @dario-piotrowicz! - performance improvement: restart a mixed mode session only if the worker's remote bindings have changed -
Updated dependencies [
3b61c41,bd528d5,2177fb4,1d3293f,04f9164,36113c2,49f5ac7,cf33417,521eeb9,02e2c1e,02e2c1e,3b61c41,e16fcc7,c117904,fae8c02]:
1.6.0
Minor Changes
-
#9510
590d69bThanks @jamesopstad! - Enhanced build support for Workers with assets.Assets that are imported in the entry Worker are now automatically moved to the client build output. This enables importing assets in your Worker and accessing them via the assets binding. See Static Asset Handling to find out about all the ways you can import assets in Vite.
Additionally, a broader range of build scenarios are now supported. These are:
- Assets only build with client entry/entries
- Assets only build with no client entry/entries that includes
publicdirectory assets - Worker(s) + assets build with client entry/entries
- Worker(s) + assets build with no client entry/entries that includes imported and/or
publicdirectory assets - Worker(s) build with no assets
Patch Changes
-
#9513
0e50072Thanks @jamesopstad! - Ensure that .dev.vars files cannot be accessed via the dev server or preview server. -
Updated dependencies [
1914b87,931f467,95eb47d,80b8bd9,95eb47d,9e4cd16,92305af,0b2ba45]:- wrangler@4.20.0
- miniflare@4.20250604.1
- @cloudflare/unenv-preset@2.3.3
1.5.1
Patch Changes
- Updated dependencies [
4ab5a40,485cd08,66edd2f,d1a1787,e3b3ef5,1f84092,3261957]:- miniflare@4.20250604.0
- wrangler@4.19.2
- @cloudflare/unenv-preset@2.3.3
1.5.0
Minor Changes
- #9341
2cef3abThanks @jamesopstad! - Support loading all asset types via assets binding. Previously only HTML assets could be loaded via the assets binding. The binding now integrates with Vite's internal middleware to load all asset types.
Patch Changes
- Updated dependencies [
db2cdc6]:
1.4.0
Minor Changes
-
#9173
fac2f9dThanks @edmundhung! - Enable cross-process Service bindings and Tail workers with the Dev RegistryYou can now run workers in separate dev sessions—whether
vite devorwrangler dev—and they’ll automatically discover and connect to each other:Worker A
// ./worker-a/wrangler.jsonc { "name": "worker-a", "main": "./src/index.ts", "services": [ { "binding": "SERVICE", "service": "worker-b" } ] }Worker B
// ./worker-b/wrangler.jsonc { "name": "worker-b", "main": "./src/index.ts", "tail_consumers": [ { "service": "worker-a" } ] }Then run both workers in separate terminals:
# Terminal 1 cd worker-a vite dev # Terminal 2 cd worker-b vite dev # or `wrangler dev` if you preferThat's it!
Patch Changes
-
#9410
87f3843Thanks @dario-piotrowicz! - silenceremotewrangler config warnings when mixed mode is enabled -
Updated dependencies [
03b8c1c,8c7ce77,80e75f4,80e75f4,b3be057,87f3843,fac2f9d,92719a5]:
1.3.1
Patch Changes
-
#9387
e39a45fThanks @jamesopstad! - Prevent leaking Miniflare server logs. Logs that were previously filtered were leaking as they were changed to include colors. We now override the new MiniflareLog.logReadymethod with a noop rather than filtering the logs. -
#9308
d3a6eb3Thanks @dario-piotrowicz! - Add newmixedModeexperimental optionAdd a new
mixedModeexperimental option that allows uses to have their worker access remote resources during development (and preview)To enabled mixed mode set the corresponding option to the cloudflare plugin instantiation:
export default defineConfig({ plugins: [ cloudflare({ // ... experimental: { mixedMode: true }, }), ], });Thereafter bindings configured with the
remoteflags will be accessible by workers' code when run viavite devandvite preview -
Updated dependencies [
34b6174,d9d937a,e39a45f,d3a6eb3,b8f058c,fdae3f7]:
1.3.0
Minor Changes
- #9330
34c71ceThanks @edmundhung! - Updated internal configuration to use Miniflare’s newdefaultPersistRootinstead of per-pluginpersistflags
Patch Changes
- Updated dependencies [
34c71ce,f7c82a4,7ddd865,6479fc5,410d985,e5ae13a,6c03bde,c2678d1,34c71ce,cc7fae4]:
1.2.4
Patch Changes
-
#9322
1bae861Thanks @justinvdm! - Fix regex to correctly detect additional module imports with __ in path -
Updated dependencies [
7344344]:
1.2.3
Patch Changes
-
Updated dependencies [
2fe6219,66d975e,5ab035d,02d40ed,2ef31a9,db5ea8f,f2a16f1,3b8f7f1,16de0d5,b87b472]:
1.2.2
Patch Changes
- Updated dependencies [
33daa09,3b384e2]:- wrangler@4.15.2
- miniflare@4.20250508.2
- @cloudflare/unenv-preset@2.3.2
1.2.1
Patch Changes
-
Updated dependencies [
f61a08e,07f4010,ea71df3,d033a7d]:- @cloudflare/unenv-preset@2.3.2
- wrangler@4.15.1
- miniflare@4.20250508.1
1.2.0
Minor Changes
- #9152
dca4163Thanks @jamesopstad! - Support HTTPS and HTTP/2. Configuringserver.httpsand/orpreview.httpsin your Vite config now works as expected. This was previously broken because Undici would add atransfer-encodingheader for streamed responses. We now remove this header if the request uses HTTP/2.
Patch Changes
- Updated dependencies [
6b42c28,37af035,ceeb375,53ba97d,349cffc,02f0699,91d0c40,362cb0b,f6f1a18,415520e,63a6504,2cc8197,6b42c28,f17ee08]:- wrangler@4.15.0
- miniflare@4.20250508.0
- @cloudflare/unenv-preset@2.3.1
1.1.1
Patch Changes
- Updated dependencies [
df5d1f6,4672bda,826c5e8,c6b3f10,078c568,8c3cdc3]:- miniflare@4.20250507.0
- wrangler@4.14.3
- @cloudflare/unenv-preset@2.3.1
1.1.0
Minor Changes
- #9108
bb41346Thanks @jamesopstad! - Add support for running Vite in middleware mode. This enables using Storybook with the Vite plugin, which would previously crash. WebSocket connections to Workers are not supported when in middleware mode.
Patch Changes
-
#9115
f901e14Thanks @penalosa! - Don't crash on non-existent tail consumers when runningvite dev -
Updated dependencies [
cdc88d8,357d42a,508a1a3,82e220e]:- wrangler@4.14.1
- miniflare@4.20250428.1
- @cloudflare/unenv-preset@2.3.1
1.0.13
Patch Changes
- Updated dependencies [
d2ecc76,9bf55aa,0b4d22a,3b60131,137d2da]:- miniflare@4.20250428.0
- wrangler@4.14.0
- @cloudflare/unenv-preset@2.3.1
1.0.12
Patch Changes
- Updated dependencies [
2c50115]:- miniflare@4.20250424.1
- wrangler@4.13.2
- @cloudflare/unenv-preset@2.3.1
1.0.11
Patch Changes
-
#9039
a9190deThanks @jamesopstad! - Fixes two bugs that were caused by not accounting for an undocumented method on Workers and Durable Objects.ctx.blockConcurrencyWhilewill now successfully block execution in Durable Objects and invoking Workers will no longer cause unhandled rejections. -
Updated dependencies [
fc47c79,f5ebb33,6291fa1,0838f1b,234afae]:- miniflare@4.20250424.0
- wrangler@4.13.1
- @cloudflare/unenv-preset@2.3.1
1.0.10
Patch Changes
- Updated dependencies [
c409318,5ce70bd,3f0adf3,0cfcfe0]:- wrangler@4.13.0
- miniflare@4.20250422.0
- @cloudflare/unenv-preset@2.3.1
1.0.9
Patch Changes
- Updated dependencies [
2a7749b,41f095b]:- miniflare@4.20250417.0
- wrangler@4.12.1
- @cloudflare/unenv-preset@2.3.1
1.0.8
Patch Changes
- Updated dependencies [
eab7ad9,62c40d7,5de2b9a,69864b4]:- wrangler@4.12.0
- miniflare@4.20250416.0
- @cloudflare/unenv-preset@2.3.1
1.0.7
Patch Changes
-
#8786
191ebc1Thanks @dario-piotrowicz! - fix: make sure users can change inspector port when running vite devEnsure that the inspector port is updated if the user modifies it in the Vite config while the dev server is running.
-
Updated dependencies [
bab1724,511be3d,085a565]:- wrangler@4.11.1
- miniflare@4.20250410.1
- @cloudflare/unenv-preset@2.3.1
1.0.6
Patch Changes
-
#8878
d04c69fThanks @petebacondarwin! - add support for Node.js ALS compat mode -
Updated dependencies [
c912b99,f5413c5,f2802f9,d2b44a2,4cc036d,84ecfe9]:- wrangler@4.11.0
- miniflare@4.20250410.0
- @cloudflare/unenv-preset@2.3.1
1.0.5
Patch Changes
-
#8685
8e87754Thanks @dario-piotrowicz! - make sure that.dev.varsfiles trigger a full reload -
Updated dependencies [
b7ac367,dcce2ec,5388447]:- miniflare@4.20250409.0
- wrangler@4.10.0
- @cloudflare/unenv-preset@2.3.1
1.0.4
Patch Changes
- #8862
f843447Thanks @jamesopstad! - Fix a bug where Node.js externals (i.e. Node.js imports that are included in the runtime) were being registered as missing imports with thedepsOptimizer. This was previously causing the dev server to crash if these imports were encountered when using React Router.
1.0.3
Patch Changes
- Updated dependencies [
d454ad9]:- miniflare@4.20250408.0
- wrangler@4.9.1
- @cloudflare/unenv-preset@2.3.1
1.0.2
Patch Changes
-
#8823
f566680Thanks @dario-piotrowicz! - fix: replaceprocess.env.NODE_ENVfor nodejs_compat buildsmake sure that occurrences of
process.env.NODE_ENVare replaced with the currentprocess.env.NODE_ENVvalue or"production"on builds that include thenodejs_compatflag, this enables libraries checking such value (e.g.react-dom) to be properly treeshaken -
Updated dependencies [
afd93b9,930ebb2,09464a6,62df08a]:- miniflare@4.20250405.1
- wrangler@4.9.0
- @cloudflare/unenv-preset@2.3.1
1.0.1
Patch Changes
-
#8806
2f47670Thanks @jamesopstad! - Replace assertion in vite-plugin-cloudflare:nodejs-compat plugin transform hook with early return. This prevents an error from being logged when building with React Router and TailwindCSS. -
Updated dependencies [
4e69fb6,93267cf,ec7e621,75b454c,d4c1171]:- wrangler@4.8.0
- miniflare@4.20250405.0
- @cloudflare/unenv-preset@2.3.1
1.0.0
Major Changes
-
#8787
3af2e30Thanks @jamesopstad! - Release version 1.0.See https://developers.cloudflare.com/workers/vite-plugin/ for more information.
Patch Changes
- Updated dependencies [
e0efb6f,2650fd3,196f51d,0a401d0]:- miniflare@4.20250404.0
- wrangler@4.7.2
- @cloudflare/unenv-preset@2.3.1
0.1.21
Patch Changes
-
#8768
beb8a6fThanks @jamesopstad! - No longer warn if the user setsupload_source_mapsin the Worker config. -
#8767
61b916eThanks @jamesopstad! - Fix inspector port change being logged on server restarts. An available inspector port is now found on the initial server start and reused across restarts. -
Updated dependencies [
7427004,007f322,199caa4,80ef13c,55b336f,245cfbd]:- wrangler@4.7.1
- miniflare@4.20250321.2
- @cloudflare/unenv-preset@2.3.1
0.1.20
Patch Changes
-
#8688
28522aeThanks @petebacondarwin! - Ensure that Node.js polyfills are pre-optimized before the first requestPreviously, these polyfills were only optimized on demand when Vite became aware of them. This was either because Vite was able to find an import to a polyfill when statically analysing the import tree of the entry-point, or when a polyfilled module was dynamically imported as part of a executing code to handle a request.
In the second case, the optimizing of the dynamically imported dependency causes a reload of the Vite server, which can break applications that are holding state in modules during the request. This is the case of most React type frameworks, in particular React Router.
Now, we pre-optimize all the possible Node.js polyfills when the server starts before the first request is handled.
-
#8680
8dcc50fThanks @dario-piotrowicz! - fix: make sure that users can specify inspector port0to use a random port -
#8572
e6fea13Thanks @dario-piotrowicz! - Add validation for theconfigPathoption in the plugin config that clearly indicates any issues. -
#8672
d533f5eThanks @dario-piotrowicz! - replace modules runtime checks with vite environment config validationcurrently at runtime the vite plugin applies checks to make sure that external files are not being imported, such checks are however too restrictive and prevent worker code to perform some valid imports from node_modules (e.g.
import stylesheet from "<some-package>/styles.css?url";)the changes here replace the runtime checks (allowing valid imports from node_modules) with some validation to the worker vite environment configurations, specifically they make sure that the environment doesn't specify invalid
optimizeDeps.excludeandresolve.externaloptions -
#8680
8dcc50fThanks @dario-piotrowicz! - fix: make sure that the plugin keeps looking for available inspector ports by defaultthis change updates the plugin so that if an inspector port is not specified and the default inspector port (9229) is not available it keeps looking for other available port instead of crashing
-
Updated dependencies [
3993374,8df60b5,ec1f813,624882e]:- wrangler@4.7.0
- @cloudflare/unenv-preset@2.3.1
0.1.19
Patch Changes
-
#8706
25eaf3bThanks @jamesopstad! - Set thex-forwarded-hostheader to the original host in requests. This fixes a bug where libraries such as Clerk would redirect to the workerd host rather than the Vite host. -
Updated dependencies [
ecbab5d,24c2c8f]:- wrangler@4.6.0
- @cloudflare/unenv-preset@2.3.1
0.1.18
Patch Changes
-
#8702
fcd71f8Thanks @petebacondarwin! - ensure that we don't crash when logging Node.js warnings when running in react-router builds -
#8207
910007bThanks @petebacondarwin! - Show warning if the user has forgotten to turn on nodejs_compat -
Updated dependencies [
cad99dc,f29f018]:- miniflare@4.20250321.1
- wrangler@4.5.1
- @cloudflare/unenv-preset@2.3.1
0.1.17
Patch Changes
-
#8652
a18155fThanks @jamesopstad! - Fix a bug where updating config files would crash the dev server. This occurred because the previous Miniflare instance was not disposed before creating a new one. This would lead to a port collision because of theinspectorPortintroduced by the new debugging features. -
Updated dependencies [
8e3688f,f043b74,14602d9]:- wrangler@4.5.0
- @cloudflare/unenv-preset@2.3.1
0.1.16
Patch Changes
-
#8432
d611cafThanks @GregBrimble! - Experimental: add support for Workers Assets metafiles (_headers and _redirects) invite dev.Experimental feature: This feature is being made available behind an experimental option (
headersAndRedirectsDevModeSupport) in the cloudflare plugin configuration. It could change or be removed at any time.cloudflare({ // ... experimental: { headersAndRedirectsDevModeSupport: true }, }),Currently, in this experimental mode, requests that would result in an HTML response or a 404 response will take into account the _headers and _redirects settings.
Known limitation: requests for existing static assets will be served directly by Vite without considering the _headers or _redirects settings.
Production deployments or using
vite previewalready accurately supports the_headersand_footersfeatures. The recommendation is to usevite previewfor local testing of these settings. -
Updated dependencies [
7682675,9c844f7,d8c0495,29cb306,e4b76e8]:- miniflare@4.20250321.0
- wrangler@4.4.1
- @cloudflare/unenv-preset@2.3.1
0.1.15
Patch Changes
-
#8556
b7d6b7dThanks @GregBrimble! - Add support forassets_navigation_prefer_asset_servingin Vite (devandpreview) -
#8608
dee6068Thanks @dario-piotrowicz! - exportPluginConfigtype -
#8507
57ddaacThanks @dario-piotrowicz! - fix: make sure that internal variables are not exposed in the importableenvobject -
Updated dependencies [
d8f1c49,b7d6b7d,4a5f270,5f151fc,5d78760,0d1240b,c0d0cd0,1c94eee]:- miniflare@4.20250320.0
- wrangler@4.4.0
- @cloudflare/unenv-preset@2.3.0
0.1.14
Patch Changes
-
#8365
f3db430Thanks @petebacondarwin! - update vite-plugin to use the latest unenv-preset -
#8489
37adc1dThanks @dario-piotrowicz! - fix: make sureprocess.envis populated when thenodejs_compat_populate_process_envflag is set -
#8587
18fa891Thanks @jamesopstad! - Add support for.wasm?initextension to load WebAssembly as documented by Vite (https://vite.dev/guide/features.html#webassembly). -
#8441
257e7f9Thanks @dario-piotrowicz! - addinspectorPortoption to plugin configadd an
inspectorPortoption that allows developers to start a devTools inspector server to debug their workers (defaulting to9229) -
#8545
aadb49cThanks @jamesopstad! - Makeassetsfield optional in the Worker config when using assets. At build time, assets are included if there is a client build. -
#8441
257e7f9Thanks @dario-piotrowicz! - add/__debugpath for better debuggingadd a new
/__debugpath that users can navigate to in order to debug their workers -
#8387
dbbeb23Thanks @jamesopstad! - Support Text and Data module types. Text modules can be imported with a.txtor.htmlextension while Data modules can be imported with a.binextension. This expands on the existing support for WebAssembly modules, which can now be imported with.wasmor.wasm?moduleextensions. Custom rules are not supported. More info on including non-JavaScript modules can be found here. -
Updated dependencies [
9adbd50,dae7bd4,383dc0a,c4fa349,8278db5,86ab0ca,a25f060,a7bd79b,62d5471,2a43cdc,5ae12a9,29015e5]:- miniflare@4.20250319.0
- wrangler@4.3.0
- @cloudflare/unenv-preset@2.3.0
0.1.13
Patch Changes
-
#8505
03435ccThanks @jamesopstad! - Support Wrangler v4 as peer dependency. -
#8523
c7f86cbThanks @dario-piotrowicz! - add validation for the Wrangler configmainfield -
#8515
3d69e52Thanks @jamesopstad! - SettargetinoptimizeDeps.esbuildOptionstoes2022. This fixes a bug where the target for prebundled dependencies did not match the build target. -
Updated dependencies [
14680b9,fd9dff8,ff26dc2,05973bb,4ad78ea]:- wrangler@4.2.0
- miniflare@4.20250317.1
- @cloudflare/unenv-preset@2.2.0
0.1.12
Patch Changes
- Updated dependencies [
b8fd1b1,4978e5b,5ae180e,74b0c73,931b53d,edf169d,1b2aa91]:- wrangler@4.1.0
- miniflare@4.20250317.0
- @cloudflare/unenv-preset@2.0.2
0.1.11
Patch Changes
- Updated dependencies [
869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b,869ec7b]:- wrangler@4.0.0
- miniflare@4.20250310.0
- @cloudflare/unenv-preset@2.0.2
0.1.10
Patch Changes
-
#8273
e3efd68Thanks @penalosa! - Support AI, Vectorize, and Images bindings when using@cloudflare/vite-plugin -
Updated dependencies [
8d6d722,8242e07,e3efd68,a352798,53e6323,4d9d9e6]:- wrangler@3.114.1
- miniflare@3.20250310.0
- @cloudflare/unenv-preset@2.0.2
0.1.9
Patch Changes
-
#8356
d1d5b53Thanks @jamesopstad! - Support dynamic import paths in preview mode. -
Updated dependencies [
2d40989,da568e5,cf14e17,79c7810]:- miniflare@3.20250224.0
- @cloudflare/unenv-preset@2.0.0
0.1.8
Patch Changes
-
#8320
c8fab4dThanks @threepointone! - chore: tweak a couple of error messages in the vite pluginI was seeing an error like this:
Unexpected error: no match for module path.. But it wasn't telling me what the path was. On debugging I noticed that it was telling me about the module "path"! Which meant I needed to enable node_compat. This patch just makes the messaging a little clearer.(Ideally we'd spot that it was a node builtin and recommend turning on node_compat, but I'll leave that to you folks.)
-
Updated dependencies [
fce642d,ff96a70,a4909cb]:- miniflare@3.20250214.2
- @cloudflare/unenv-preset@2.0.0
0.1.7
Patch Changes
-
#8206
477f8d9Thanks @jamesopstad! - Add support for binding to named entrypoints in the same worker -
#8266
9f05e8fThanks @jamesopstad! - Make it possible to overridebuilder.buildAppin the user config or prior plugins -
Updated dependencies []:
- @cloudflare/unenv-preset@1.1.2
0.1.6
Patch Changes
- Updated dependencies [
a9a4c33,6cae13a]:- miniflare@3.20250214.1
- @cloudflare/unenv-preset@1.1.2
0.1.5
Patch Changes
-
#8231
51a2fd3Thanks @petebacondarwin! - fix: use ESM WebSocketServer import to avoid crashing vite devIt appears that if there are multiple versions of the
wspackage in a user's project then the Node.js resolution picks up the ESM "import" package export rather than the "require" package export. This results in the entry-point having different JS exports: In particular the default export no longer contains aServerproperty; instead one must import theWebSocketServernamed JS export. While it is not clear why the Node.js behaviour changes in this way, the cleanest fix is to import theWebSocketServerdirectly.
0.1.4
Patch Changes
-
#8209
1427535Thanks @jamesopstad! - Fix bug with usage of Cloudflare builtins in dependencies. These are now externalized during dependency optimization. -
Updated dependencies []:
- @cloudflare/unenv-preset@1.1.2
0.1.3
Patch Changes
- #8176
693d63eThanks @petebacondarwin! - fix: refactor Node.js compat support to ensure all polyfills are pre-bundled before the first request
0.1.2
Patch Changes
- Updated dependencies [
5e06177]:- miniflare@3.20250214.0
- @cloudflare/unenv-preset@1.1.2
0.1.1
Patch Changes
-
#8118
ca3cbc4Thanks @petebacondarwin! - fix Node.js compat module resolutionIn v0.0.8 we landed support for Vite 6.1 and also switched to using the new Cloudflare owned unenv preset. Unfortunately, the changes made in that update caused a regression in Node.js support. This became apparent only when the plugin was being used with certain package managers and outside of the workers-sdk monorepo.
The unenv polyfills that get compiled into the Worker are transitive dependencies of this plugin, not direct dependencies of the user's application were the plugin is being used. This is on purpose to avoid the user having to install these dependencies themselves.
Unfortunately, the changes in 0.0.8 did not correctly resolve the polyfills from
@cloudflare/unenv-presetandunenvwhen the dependencies were not also installed directly into the user's application.The approach was incorrectly relying upon setting the
importerin calls to Vite'sresolve(id, importer)method to base the resolution in the context of the vite plugin package rather than the user's application. This doesn't work because theimporteris only relevant when theidis relative, and not a bare module specifier in the case of the unenv polyfills.This change fixes how these id are resolved in the plugin by manually resolving the path at the appropriate point, while still leveraging Vite's resolution pipeline to handle aliasing, and dependency optimization.
This change now introduces e2e tests that checks that isolated installations of the plugin works with npm, pnpm and yarn.
-
Updated dependencies [
28b1dc7]:- wrangler@3.109.1
- @cloudflare/unenv-preset@1.1.2
0.1.0
Minor Changes
-
#8080
d0fda3dThanks @jamesopstad! - No longer callnextin server middleware.This is so that the Cloudflare plugin can override subsequent dev middleware for framework integrations.
Patch Changes
-
#8079
1b07419Thanks @jamesopstad! - CallwriteDeployConfiginwriteBundlerather thanbuilder.buildApp.The deploy config file is now written in the
writeBundlehook rather thanbuilder.buildApp. This ensures that the file is still written if other plugins overridebuilderin the Vite config. -
Updated dependencies [
3fb801f,fff677e,3fb801f,542c6ea,3fb801f,4db1fb5,542c6ea,1bc60d7,1aa2a91,35710e5]:- wrangler@3.109.0
- miniflare@3.20250204.1
- @cloudflare/unenv-preset@1.1.2
0.0.8
Patch Changes
-
#7830
99ba292Thanks @petebacondarwin! - add support for Vite 6.1 -
#7830
99ba292Thanks @petebacondarwin! - implement the new Cloudflare unenv preset into the Vite plugin
0.0.7
Patch Changes
-
#8091
9a3d525Thanks @jamesopstad! - Omit files from public directory in Worker builds -
#8083
027698cThanks @jamesopstad! - Ensure the correct data types are sent in WebSocket messages from the client to the Worker -
#8031
07db54cThanks @jamesopstad! - Add support for Wasm (WebAssembly) modules. -
Updated dependencies [
b1966df,c80dbd8,1f80d69,88514c8,9d08af8,6abe69c,0c0374c,b2dca9a,6abe69c,c412a31,60310cd,71fd250]:
0.0.6
Patch Changes
0.0.5
Patch Changes
-
#7864
de6fa18Thanks @dario-piotrowicz! - Add full support for.dev.varsfiles.This change makes sure that
.dev.varsfiles work when the environment is specified. It also copies the target.dev.varsfile (which might be environment specific, e.g..dev.vars.prod) to the worker's dist directory so thatvite previewcan pick it up. The copied file will always be named.dev.vars. -
Updated dependencies [
d758215,34f9797,f57bc4e,cf4f47a,38db4ed,de6fa18,bc4d6c8]:
0.0.4
Patch Changes
0.0.3
Patch Changes
0.0.2
Patch Changes
-
#7846
cd31971Thanks @dario-piotrowicz! - fix: make sure that runner initialization is properly validated