Problem
vinext init --platform cloudflare adds a deploy script pointing at a path the Cloudflare build never produces:
"deploy:vinext": "vinext-cloudflare deploy --config dist/server/wrangler.json"
With @cloudflare/vite-plugin, vinext build emits the Worker (and its generated wrangler.json) into dist/<worker-name>/, following the plugin's own output convention. For a Worker named my-app in wrangler.jsonc, the build produces:
dist/
├── client/
└── my-app/
├── index.js
├── wrangler.json <-- generated config lives here
└── .dev.vars
dist/server/wrangler.json does not exist, so the scaffolded deploy script cannot work as generated. It only coincides for a project whose Worker happens to be named server.
Reproduction
-
Scaffold a Pages Router project for Cloudflare:
vinext init --platform cloudflare --skip-check
-
Build:
-
Compare the generated script with the build output:
$ grep deploy:vinext package.json
"deploy:vinext": "vinext-cloudflare deploy --config dist/server/wrangler.json"
$ ls dist/server/wrangler.json
ls: dist/server/wrangler.json: No such file or directory
$ ls dist/*/wrangler.json
dist/my-app/wrangler.json
Expected
The generated deploy:vinext script points at the config the build actually emits — resolved from the Worker name in wrangler.jsonc (or discovered at deploy time) rather than hard-coded to dist/server/.
Environment
- vinext
1.0.0-beta.6
@cloudflare/vite-plugin, wrangler 4.123.0
- Vite
8.1.0
- Pages Router,
vinext init --platform cloudflare
Related
Same root cause as the vinext start mismatch I am filing alongside this: Cloudflare output goes to dist/<worker-name>/, while the surrounding tooling assumes dist/server/.
Problem
vinext init --platform cloudflareadds a deploy script pointing at a path the Cloudflare build never produces:With
@cloudflare/vite-plugin,vinext buildemits the Worker (and its generatedwrangler.json) intodist/<worker-name>/, following the plugin's own output convention. For a Worker namedmy-appinwrangler.jsonc, the build produces:dist/server/wrangler.jsondoes not exist, so the scaffolded deploy script cannot work as generated. It only coincides for a project whose Worker happens to be namedserver.Reproduction
Scaffold a Pages Router project for Cloudflare:
Build:
Compare the generated script with the build output:
Expected
The generated
deploy:vinextscript points at the config the build actually emits — resolved from the Worker name inwrangler.jsonc(or discovered at deploy time) rather than hard-coded todist/server/.Environment
1.0.0-beta.6@cloudflare/vite-plugin,wrangler4.123.08.1.0vinext init --platform cloudflareRelated
Same root cause as the
vinext startmismatch I am filing alongside this: Cloudflare output goes todist/<worker-name>/, while the surrounding tooling assumesdist/server/.