Problem
vinext deploy requires cloudflare() (@cloudflare/vite-plugin) in the Vite config, but when a project has a custom vite.config.ts, vinext deploy doesn't add it and fails:
Created wrangler.jsonc
Created worker/index.ts
Error: [vinext] Missing @cloudflare/vite-plugin in your Vite config.
...
Or delete your Vite config and re-run `vinext deploy` to auto-generate it.
The "delete your Vite config and re-run" suggestion isn't viable for a real port — the custom config carries required resolution/transform settings. So you must hand-add cloudflare() and install @cloudflare/vite-plugin.
Compounding it: @cloudflare/vite-plugin requires a wrangler config to exist, but vinext deploy only generates wrangler.jsonc at deploy time — so adding cloudflare() unconditionally breaks local vinext build/dev (no wrangler.jsonc). You end up either committing wrangler.jsonc or gating the plugin on its presence.
Suggested fix
- When a custom Vite config is present,
vinext deploy could inject cloudflare() (and install the dep) automatically, the same way it does when generating the config.
- Document the local-vs-deploy story for
cloudflare() + the generated wrangler.jsonc (when to commit it, how to keep local vinext dev/build working).
(Related to the Cloudflare-dashboard deploy friction in #2.)
Problem
vinext deployrequirescloudflare()(@cloudflare/vite-plugin) in the Vite config, but when a project has a customvite.config.ts,vinext deploydoesn't add it and fails:The "delete your Vite config and re-run" suggestion isn't viable for a real port — the custom config carries required resolution/transform settings. So you must hand-add
cloudflare()and install@cloudflare/vite-plugin.Compounding it:
@cloudflare/vite-pluginrequires a wrangler config to exist, butvinext deployonly generateswrangler.jsoncat deploy time — so addingcloudflare()unconditionally breaks localvinext build/dev(nowrangler.jsonc). You end up either committingwrangler.jsoncor gating the plugin on its presence.Suggested fix
vinext deploycould injectcloudflare()(and install the dep) automatically, the same way it does when generating the config.cloudflare()+ the generatedwrangler.jsonc(when to commit it, how to keep localvinext dev/buildworking).(Related to the Cloudflare-dashboard deploy friction in #2.)