Build for deployment at the article's public path - #3
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares the article for its own Vercel deployment, so
policyengine-app-v2can 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-chatand 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-chatmeans an asset URL resolves identically whether the reader arrives via policyengine.org or the deployment directly — the pattern/uk/chatand the WATCA calculator already use.vercel.jsonpins 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 devnow serves at that path rather than/; Vite prints the full URL on start.bun run checkpasses.