fix: lifecycle buildindex sort (#6568)

This commit is contained in:
Xiao Chuan
2023-05-20 20:55:32 +08:00
committed by GitHub
parent f5121500ee
commit 6ce3424a9a
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/lifecycle": patch
"pnpm": patch
---
Build projects in a workspace in correct order [#6568](https://github.com/pnpm/pnpm/pull/6568).

View File

@@ -38,7 +38,7 @@ export async function runLifecycleHooksConcurrently (
importersByBuildIndex.get(importer.buildIndex)!.push(importer)
}
}
const sortedBuildIndexes = Array.from(importersByBuildIndex.keys()).sort()
const sortedBuildIndexes = Array.from(importersByBuildIndex.keys()).sort((a, b) => a - b)
const groups = sortedBuildIndexes.map((buildIndex) => {
const importers = importersByBuildIndex.get(buildIndex)!
return importers.map(({ manifest, modulesDir, rootDir, stages: importerStages, targetDirs }) =>