From 8d6a32b38b02a8132a118a02c96ba5fae6b8436c Mon Sep 17 00:00:00 2001 From: Aswinmcw Date: Tue, 14 Jul 2026 03:16:43 +0000 Subject: [PATCH] wrangler: run embed via build.command so preview (versions upload) builds 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 --- wrangler.jsonc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wrangler.jsonc b/wrangler.jsonc index b52aa6b..8026f4b 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -10,6 +10,12 @@ // PR comment. Without this the deploy succeeds but no Preview URL is shown. "preview_urls": true, + // Generate the self-contained resume.embedded.html (inline fonts + photo) + // before bundling. Put here (not just npm predeploy hooks) so it runs no + // matter which wrangler command CI invokes — `deploy` (production) or + // `versions upload` (non-production / preview builds). + "build": { "command": "npm run embed" }, + "observability": { "enabled": true, "head_sampling_rate": 1 }, // Managed headless Chromium (Browser Run) used to render the PDF at runtime.