fix: move Worker config to separate file for Pages compatibility

Move wrangler.toml to worker/wrangler.toml to separate Worker and Pages configurations.
Cloudflare Pages was trying to read wrangler.toml and failing because it contained
Worker-specific configuration (Durable Objects, migrations, etc.) that Pages doesn't support.

Changes:
- Move wrangler.toml → worker/wrangler.toml
- Update deploy scripts to use --config worker/wrangler.toml
- Pages deployment now uses Cloudflare dashboard configuration only

This resolves the deployment error:
"Configuration file cannot contain both 'main' and 'pages_build_output_dir'"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2025-11-16 04:14:40 -07:00
parent 9937a8fe16
commit 59d0b9a5ff
2 changed files with 5 additions and 6 deletions

View File

@ -11,9 +11,9 @@
"build": "tsc && vite build", "build": "tsc && vite build",
"build:worker": "wrangler build --config wrangler.dev.toml", "build:worker": "wrangler build --config wrangler.dev.toml",
"preview": "vite preview", "preview": "vite preview",
"deploy": "tsc && vite build && wrangler deploy", "deploy": "tsc && vite build && wrangler deploy --config worker/wrangler.toml",
"deploy:pages": "tsc && vite build", "deploy:pages": "tsc && vite build",
"deploy:worker": "wrangler deploy", "deploy:worker": "wrangler deploy --config worker/wrangler.toml",
"deploy:worker:dev": "wrangler deploy --config wrangler.dev.toml", "deploy:worker:dev": "wrangler deploy --config wrangler.dev.toml",
"types": "tsc --noEmit" "types": "tsc --noEmit"
}, },

View File

@ -1,7 +1,6 @@
# Cloudflare Pages configuration # Worker configuration
pages_build_output_dir = "dist" # Note: This wrangler.toml is for the Worker backend only.
# Pages deployment is configured separately in the Cloudflare dashboard.
# Worker configuration (for Pages Functions)
main = "worker/worker.ts" main = "worker/worker.ts"
compatibility_date = "2024-07-01" compatibility_date = "2024-07-01"
name = "jeffemmett-canvas" name = "jeffemmett-canvas"