Skip to content

fix: normalize Cloudflare deploy config base path - #9

Merged
WangEn merged 10 commits into
mainfrom
fix/cloudflare-deploy-config-base
Sep 11, 2026
Merged

fix: normalize Cloudflare deploy config base path#9
WangEn merged 10 commits into
mainfrom
fix/cloudflare-deploy-config-base

Conversation

@WangEn

@WangEn WangEn commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

What broke

Cloudflare Vite generates apps/web/.wrangler/deploy/config.json after vite build, while Dockmark's canonical user config lives at repository-root wrangler.jsonc. Running wrangler deploy from the Web workspace made Wrangler see the two configs with different base paths and abort.

Fix

  • keep root wrangler.jsonc as the canonical input config so Deploy-to-Cloudflare can still see/provision D1
  • keep Vite reading that root config
  • add scripts/prepare-cloudflare-deploy.mjs to promote Vite's generated deploy redirect to root .wrangler/deploy/config.json while preserving its generated output target
  • move production deploy orchestration to the monorepo root
  • make D1 migrations use the DB binding rather than the database name
  • remove workspace-level deploy scripts that can reproduce the base-path conflict
  • add wrangler deploy --dry-run to CI so generated-config deployment failures are caught before merge
  • update README with the correct Workers Builds commands and monorepo constraints

Expected Cloudflare configuration

  • Root directory: /
  • Build command: npm run build:web
  • Deploy command: npm run deploy:built
  • Production branch: main

The existing root npm run deploy remains appropriate for Deploy-to-Cloudflare and local CLI use because it builds the Web workspace before running the same root deployment flow.

@WangEn
WangEn merged commit 7f9aabc into main Sep 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant