Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > PnpmOptionsConfiguration > globalPackageExtensions

PnpmOptionsConfiguration.globalPackageExtensions property

The globalPackageExtension setting provides a way to patch arbitrary package.json fields for any PNPM dependency of the monorepo. The settings are copied into the pnpm.packageExtensions field of the common/temp/package.json file that is generated by Rush during installation. The globalPackageExtension setting has similar capabilities as .pnpmfile.cjs but without the downsides of an executable script (nondeterminism, unreliable caching, performance concerns).

Order of precedence: .pnpmfile.cjs has the highest precedence, followed by unsupportedPackageJsonSettings, globalPeerDependencyRules, globalPackageExtensions, and globalOverrides has lowest precedence.

PNPM documentation: https://pnpm.io/package\_json\#pnpmpackageextensions

Signature:

readonly globalPackageExtensions: Record<string, IPnpmPackageExtension> | undefined;