wrangler: embed via build.command (make preview builds work)#10
Merged
Conversation
…ilds work The embed step (generate self-contained resume.embedded.html) only ran through npm predeploy/prebuild hooks, i.e. only for `npm run deploy`. When CF runs a non-production build with `wrangler versions upload` (the Version command for PR/preview builds), those hooks are bypassed and the bundle would be stale or missing. Move the embed into wrangler's build.command so it runs for every wrangler entrypoint (deploy and versions upload alike). Paired with the dashboard fix: set the Workers Builds "Version command" to `npx wrangler versions upload` (currently `npx wrangler deploy`, which is why PR builds deployed to production and produced no preview URL). Verified: `wrangler versions upload --dry-run` bundles cleanly (422KB gzip); tsc clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
resume | 8d6a32b | Jul 14 2026, 03:17 AM |
Aswincloud-Bot
approved these changes
Jul 14, 2026
Aswincloud-Bot
left a comment
There was a problem hiding this comment.
Auto-approved: @Aswinmcw is a member of @Aswincloud/admins.
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.
Context
The Workers Builds config explains why PR preview URLs never appeared:
The Version command runs for non-production (PR/branch) builds. Set to
wrangler deploy, PRs deployed to production and created no preview version → no preview URL. It must benpx wrangler versions upload.This PR (repo side)
Moves the embed step into wrangler's
build.commandsoresume.embedded.htmlis generated for every wrangler entrypoint —deployandversions upload. Previously embed only ran via npmpredeploy/prebuildhooks, so a bareversions uploadwould bundle a stale/missing HTML.Verified:
wrangler versions upload --dry-runbundles cleanly (422 KB gzip);tsc --noEmitclean.Dashboard side (required, not in repo)
In Workers & Pages → resume → Settings → Builds, set Version command to
npx wrangler versions upload(matchaswin-portfolio). After that, PRs get a preview URL.