Skip to content

Add one-click deploy (Vercel + Cloudflare) and VITE_SITE_URL - #2

Merged
viqueen merged 5 commits into
mainfrom
feature/vercel-template
Jul 27, 2026
Merged

Add one-click deploy (Vercel + Cloudflare) and VITE_SITE_URL#2
viqueen merged 5 commits into
mainfrom
feature/vercel-template

Conversation

@viqueen

@viqueen viqueen commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What

Make the template one-click deployable and drive the site origin from an env var.

Changes

  • One-click deploy buttons at the top of the README:
    • Vercelvercel.json sets outputDirectory: dist/client and framework: null (static, no SPA rewrite; root 404.html handles misses).
    • Cloudflare Workerswrangler.jsonc is an assets-only Worker (no server code) serving dist/client with not_found_handling: "404-page".
  • Cloudflare Pages documented in the ## Deploy section (manual "Connect to Git" — Cloudflare's deploy button is Workers-only, and its Pages config field can't coexist with the Workers assets block).
  • SITE_URL now reads VITE_SITE_URL (fallback https://example.com, trailing slash stripped). On Vercel it defaults to the project's production domain via vite.config.ts, so the button yields correct canonical/OG URLs with no config. Added .env.example and gitignored local .env files.

Build command (pnpm build) and publish dir (dist/client) are the same across all three targets.

Notes

  • No new dependencies.
  • Verified: pnpm build + type-check pass; output resolves to the example.com fallback with no real domain baked into dist.

🤖 Generated with Claude Code

viqueen and others added 5 commits July 25, 2026 15:47
Add a "Deploy with Vercel" button to the README and a vercel.json so the
clone flow builds cleanly: output points at the prerendered dist/client,
framework null to avoid the SPA rewrite and use the root 404.html.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the hardcoded SITE_URL with the VITE_SITE_URL env var (fallback
https://example.com, trailing slash stripped). On Vercel, default it to the
project's production domain so the Deploy button yields correct canonical/OG
URLs with no config. Add .env.example and gitignore local .env files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a "Deploy to Cloudflare" (Workers) button and wrangler.jsonc — an
assets-only Worker serving dist/client with 404-page handling. Document all
deploy targets in a new Deploy section, including manual Cloudflare Pages
setup (the one-click button is Workers-only).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move each deploy button onto its own line under a per-provider subsection
(Vercel, Cloudflare Workers, Cloudflare Pages) so the differently sized
button badges no longer sit misaligned side by side. Replace the stacked
buttons at the top with a pointer to the Deploy section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Put the Vercel and Cloudflare Workers buttons near the top of the README,
stacked vertically under provider labels so they read clearly and don't
misalign. The Deploy section keeps the config details and Cloudflare Pages
setup, referencing the buttons above.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@viqueen
viqueen merged commit 9379bbd into main Jul 27, 2026
1 check passed
@viqueen
viqueen deleted the feature/vercel-template branch July 27, 2026 00:10
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