Skip to content

init --platform cloudflare: generated deploy:vinext points at dist/server/wrangler.json, but the build emits dist/<worker-name>/wrangler.json #2965

Description

@james-elicx

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

  1. Scaffold a Pages Router project for Cloudflare:

    vinext init --platform cloudflare --skip-check
  2. Build:

    vinext build
  3. 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/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions