Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/app/src/cli/services/deploy/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ describe('bundleAndBuildExtensions', () => {
})
})

test('runs web build command concurrently with extensions when build command is defined', async () => {
test('runs web build before extensions when build command is defined', async () => {
await file.inTemporaryDirectory(async (tmpDir: string) => {
// Given
const bundlePath = joinPath(tmpDir, 'bundle.zip')
Expand Down
10 changes: 9 additions & 1 deletion packages/app/src/cli/services/deploy/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,16 @@ export async function bundleAndBuildExtensions(options: BundleOptions) {
},
}))

// Web builds 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.
if (webBuildProcesses.length > 0) {
await renderConcurrent({processes: webBuildProcesses, showTimestamps: false})
}

await renderConcurrent({
processes: [webBuildProcesses, extensionBuildProcesses].flat(),
processes: extensionBuildProcesses,
showTimestamps: false,
})

Expand Down
Loading