1.2 KiB
1.2 KiB
Cloudflare Pages Configuration
Issue
Cloudflare Pages cannot use the same wrangler.toml file as Workers because:
wrangler.tomlcontains Worker-specific configuration (main, account_id, triggers, etc.)- Pages projects have different configuration requirements
- Pages cannot have both
mainandpages_build_output_dirin the same file
Solution: Configure in Cloudflare Dashboard
Since wrangler.toml is for Workers only, configure Pages settings in the Cloudflare Dashboard:
Steps:
- Go to Cloudflare Dashboard
- Navigate to Pages → Your Project
- Go to Settings → Builds & deployments
- Configure:
- Build command:
npm run build - Build output directory:
dist - Root directory:
/(or leave empty)
- Build command:
- Save settings
Alternative: Use Environment Variables
If you need to configure Pages via code, you can set environment variables in the Cloudflare Pages dashboard under Settings → Environment variables.
Worker Deployment
Workers are deployed separately using:
npm run deploy:worker
or
wrangler deploy
The wrangler.toml file is used only for Worker deployments, not Pages.