workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

Vite 8 Support [@cloudflare/vite-plugin]

Open ariesclark opened this issue 1 month ago • 2 comments

What versions & operating system are you using?

npmPackages:
  @cloudflare/vite-plugin: 1.15.3 
  vite: 8.0.0-beta.0 => 8.0.0-beta.0

Please provide a minimal reproduction

pnpm create cloudflare@latest --template=cloudflare/templates/vite-react-template vite-8-cloudflare
cd vite-8-cloudflare
pnpm add [email protected]

Describe the Bug

Cloudflare's Vite plugin works without error, but causes the following warnings:

You or a plugin you are using have set `optimizeDeps.esbuildOptions` but this option is now deprecated. Vite now uses Rolldown to optimize the dependencies. Please use `optimizeDeps.rolldownOptions` instead.

Please provide any relevant error logs

No response

ariesclark avatar Dec 05 '25 05:12 ariesclark

Thanks for the issue. We'll be improving compatibility with Vite 8 during the beta period.

jamesopstad avatar Dec 05 '25 14:12 jamesopstad

Related issue: https://github.com/cloudflare/workers-sdk/issues/11299

smorimoto avatar Dec 10 '25 03:12 smorimoto

FYI one thing that doesn't work between the Cloudflare Vite plugin and Vite 8 is that the Cloudflare plugin sets "es2024" as the build target and Vite errors on build with

error during build:
Build failed with 1 error:

[plugin vite:css-post]
Error: [lightningcss minify] Unsupported target "es2024"

I've created an issue and a PR for the Vite CSS plugin to add "es2024" as a build target.

bndkt avatar Dec 18 '25 06:12 bndkt