Skip to content

Run web builds before extension builds during deploy#7315

Closed
MitchLillie wants to merge 1 commit intomainfrom
cx-sequential-web-build-before-extensions
Closed

Run web builds before extension builds during deploy#7315
MitchLillie wants to merge 1 commit intomainfrom
cx-sequential-web-build-before-extensions

Conversation

@MitchLillie
Copy link
Copy Markdown
Contributor

Problem

When deploying an app with [admin] static_root, the web build (e.g. Vite) and extension builds run in parallel via a single renderConcurrent call. The admin extension's include_assets step can attempt to copy files from static_root before the web build has finished populating it. Vite's emptyOutDir: true deletes dist/ at the start of its build, so the admin extension either sees a missing or empty directory and skips the copy. The result:

index_missing: index.html must be present in the bundle.

Solution

Split the single renderConcurrent call into two sequential phases:

  1. Web builds first — run all web build processes (Vite, etc.) to completion
  2. Extension builds second — run extension builds which may copy from web build output

Extensions within each phase still run concurrently with each other.

This makes the dependency between web builds and extensions explicit rather than relying on timing or polling.

Web builds (e.g. Vite) must complete before extension builds start.
Extensions like the admin module copy output from web builds (e.g. dist/)
into the bundle via include_assets. Running them in parallel causes a race
condition where dist/ is empty or missing when the admin extension tries
to copy it, resulting in:

  index_missing: index.html must be present in the bundle

This splits the single renderConcurrent call into two sequential phases:
web builds first, then extension builds.
@MitchLillie MitchLillie deleted the cx-sequential-web-build-before-extensions branch April 15, 2026 20:38
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.

1 participant