Skip to content

wrangler: embed via build.command (make preview builds work)#10

Merged
Aswinmcw merged 1 commit into
mainfrom
harden-build-embed
Jul 14, 2026
Merged

wrangler: embed via build.command (make preview builds work)#10
Aswinmcw merged 1 commit into
mainfrom
harden-build-embed

Conversation

@Aswinmcw

Copy link
Copy Markdown
Member

Context

The Workers Builds config explains why PR preview URLs never appeared:

Build command:   npm run deploy
Deploy command:  npx wrangler deploy
Version command: npx wrangler deploy   ← should be `npx wrangler versions upload`

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 be npx wrangler versions upload.

This PR (repo side)

Moves the embed step into wrangler's build.command so resume.embedded.html is generated for every wrangler entrypoint — deploy and versions upload. Previously embed only ran via npm predeploy/prebuild hooks, so a bare versions upload would bundle a stale/missing HTML.

Verified: wrangler versions upload --dry-run bundles cleanly (422 KB gzip); tsc --noEmit clean.

Dashboard side (required, not in repo)

In Workers & Pages → resume → Settings → Builds, set Version command to npx wrangler versions upload (match aswin-portfolio). After that, PRs get a preview URL.

…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>
@Aswinmcw
Aswinmcw requested review from a team and Aswin-coder as code owners July 14, 2026 03:16
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
resume 8d6a32b Jul 14 2026, 03:17 AM

@Aswincloud-Bot Aswincloud-Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: @Aswinmcw is a member of @Aswincloud/admins.

@Aswinmcw
Aswinmcw merged commit 61751bf into main Jul 14, 2026
2 checks passed
@Aswinmcw
Aswinmcw deleted the harden-build-embed branch July 14, 2026 03:20
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.

3 participants