fix(builder): build Vite production assets during image assembly - #1229
Closed
Koh0920 wants to merge 2 commits into
Closed
fix(builder): build Vite production assets during image assembly#1229Koh0920 wants to merge 2 commits into
Koh0920 wants to merge 2 commits into
Conversation
…erver Community capsules inferred from a package.json whose scripts declare plain `vite build` + `vite preview` now launch `sh -lc "<pm> run build && <pm> run preview -- --host 0.0.0.0 --port 8000 --strictPort"` instead of the dev server. Dev serving shipped the unbundled module graph through the app proxy — measured for drawdb: 448 requests / 115 MB before first paint (the 'ready but blank for ~30s' preview); swagger-editor's graph is 542 modules and never finishes booting. The build runs once at snapshot capture (restores resume the serving process), and the pinned v1 lane grants build-then-serve commands the capped 600 s boot budget for that capture. Compound build scripts or a missing preview script keep the dev lane (fail-closed, unchanged behavior). Claude-Session: https://claude.ai/code/session_015MNKB1dibFqVffp5UQcg8V
…at boot The first cut launched `sh -lc "npm run build && npm run preview …"` — but the v1 guest rootfs is mounted read-only (only tool-owned cache paths are tmpfs-redirected), so `vite build` writing dist/ dies on EROFS at boot and the capture burns its whole readiness budget (observed twice on the staging builder: 600 s spent, guest never healthy; the same build in an equivalent 2-cpu/6 GiB container takes 11 s). The build now runs as part of image assembly: build_v1 chains `<pm> run build` after dependency install when the launch is `<pm> run preview …` and package.json declares a plain `… vite build` script (vite_production_prebuild_cmd — evidence-based and fail-closed, same doctrine as base_image_and_install). The inferred launch becomes a plain `<pm> run preview -- --host 0.0.0.0 --port 8000 --strictPort` argv with the standard 60 s readiness, and dist/ ships read-only in the identity-bearing guest tree. The now-unneeded shell-compound seal arm and capture boot-budget special case are reverted. Claude-Session: https://claude.ai/code/session_015MNKB1dibFqVffp5UQcg8V
This was referenced Aug 2, 2026
Contributor
Author
|
Superseded by #1231 (identical patch-ids for both commits, verified with git patch-id --stable); merged to main as part of the Surface Activation v2 arc. |
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.
Summary
Strict build-script eligibility
The image-time prebuild is issued only for a recognized package-manager preview launch whose package.json build script ends in plain vite build. Shell syntax and compound build scripts are rejected; Vite detection does not authorize any static-output declaration.
CI prerequisite
Windows CI exposed an existing main failure in the builder-script test shell. The independent fix is #1230; this PR will rebase onto its merge commit and rerun the complete matrix before merge.
Static Web Bundle prerequisite
This is the minimal Vite production-lane prerequisite for ato #1227. It intentionally contains only the two independent Vite production lane commits, not unrelated surface-activation work.
No staging/production deploy or infrastructure mutation is included.