Skip to content

Build for deployment at the article's public path - #3

Merged
vahid-ahmadi merged 1 commit into
mainfrom
feat/vercel-deploy
Aug 12, 2026
Merged

Build for deployment at the article's public path#3
vahid-ahmadi merged 1 commit into
mainfrom
feat/vercel-deploy

Conversation

@vahid-ahmadi

Copy link
Copy Markdown
Contributor

Prepares the article for its own Vercel deployment, so policyengine-app-v2 can proxy to it instead of carrying a copy of the build (PolicyEngine/policyengine-app-v2#1073).

Builds at the article's public path, not the domain root. app-v2's zone routes forward /uk/introducing-policyengine-uk-chat and everything beneath it path-for-path. A build at the domain root emits /assets/…, which under policyengine.org falls outside the route and 404s. Building at /uk/introducing-policyengine-uk-chat means an asset URL resolves identically whether the reader arrives via policyengine.org or the deployment directly — the pattern /uk/chat and the WATCA calculator already use.

vercel.json pins the build command and output directory, and redirects the bare domain to the article so it is not a 404.

Verified by serving the built tree and requesting the real paths — index, JS, CSS, and images all 200 under /uk/introducing-policyengine-uk-chat/.

Note that bun run dev now serves at that path rather than /; Vite prints the full URL on start.

bun run check passes.

app-v2 serves this article by proxying /uk/introducing-policyengine-uk-chat
and everything beneath it to a deployment, path for path. Building at that same
path means an asset URL resolves identically whether the reader arrives via
policyengine.org or the deployment directly, which is how /uk/chat and the
WATCA calculator are already wired.

Without this the proxy breaks on assets: a build at the domain root emits
/assets/... , which under policyengine.org falls outside the zone route.

vercel.json pins the build command and output directory, and redirects the
deployment root to the article so the bare domain is not a 404.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vahid-ahmadi
vahid-ahmadi merged commit 6a33292 into main Aug 12, 2026
1 check passed
@vahid-ahmadi
vahid-ahmadi deleted the feat/vercel-deploy branch August 12, 2026 10:16
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