diff --git a/.changeset/fruity-corners-dance.md b/.changeset/fruity-corners-dance.md new file mode 100644 index 0000000000..e6ffe22430 --- /dev/null +++ b/.changeset/fruity-corners-dance.md @@ -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). diff --git a/pkg-manager/core/src/install/index.ts b/pkg-manager/core/src/install/index.ts index 0056c35c38..4cea46c763 100644 --- a/pkg-manager/core/src/install/index.ts +++ b/pkg-manager/core/src/install/index.ts @@ -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 }) + } } }