본문으로 건너뛰기

pnpm 10.28

· 1분 소요
Zoltan Kochan
Lead maintainer of pnpm

pnpm 10.28 introduces a new beforePacking hook to customize package.json at publish time, improves filtered install performance, and includes several bug fixes.

Minor Changes

beforePacking Hook

Added support for a new hook called beforePacking that allows you to customize the package.json contents at publish time #3816.

This hook is called just before creating the tarball when running pnpm pack or pnpm publish. It gives you the opportunity to modify the package manifest that will be included in the published package without affecting your local package.json file.

Example usage in .pnpmfile.cjs:

module.exports = {
hooks: {
beforePacking(pkg) {
// Remove development-only fields
delete pkg.devDependencies
delete pkg.scripts
// Add publication metadata
pkg.publishedAt = new Date().toISOString()
return pkg
}
}
}

See the .pnpmfile.cjs documentation for more details.

Filtered Install Performance

In some cases, a filtered install (i.e. pnpm install --filter ...) was slower than running pnpm install without any filter arguments. This performance regression is now fixed. Filtered installs should be as fast or faster than a full install #10408.

Patch Changes

  • Do not add a symlink to the project into the store's project registry if the store is in a subdirectory of the project #10411.
  • It should be possible to declare the requiredScripts setting in pnpm-workspace.yaml #10261.