fix: keep the ignoredBuilds field when installing different pkg (#9242)

* fix: keep the `ignoredBuilds` field when installing different dependencies

* fix: print warning about ignored builds

---------

close #9240

Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
btea
2025-03-19 08:09:12 +08:00
committed by Zoltan Kochan
parent f0f95abfbb
commit 36ff4bfaf1
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/core": patch
pnpm: patch
---
When installing different dependency packages, should retain the `ignoredBuilds` field in the `.modules.yaml` file [#9240](https://github.com/pnpm/pnpm/issues/9240).

View File

@@ -10,6 +10,7 @@ import {
WANTED_LOCKFILE,
} from '@pnpm/constants'
import {
ignoredScriptsLogger,
stageLogger,
summaryLogger,
} from '@pnpm/core-loggers'
@@ -1224,6 +1225,10 @@ const _installInContext: InstallFunction = async (projects, ctx, opts) => {
unsafePerm: opts.unsafePerm,
userAgent: opts.userAgent,
})).ignoredBuilds
if (ignoredBuilds == null && ctx.modulesFile?.ignoredBuilds?.length) {
ignoredBuilds = ctx.modulesFile.ignoredBuilds
ignoredScriptsLogger.debug({ packageNames: ignoredBuilds })
}
}
}