github pnpm/pnpm v2.17.0-5

latest releases: v9.0.6, v9.0.5, v9.0.4...
pre-release5 years ago

Features

Shared Monorepo node_modules and shrinkwrap.yaml

By default, when running the pnpm recursive install in a monorepo, pnpm creates a dedicated node_modules and shrinkwrap.yaml for every package in the monorepo. pnpm now allows to set the shared-workspace-shrinkwrap config to true and a single lockfile will be created in the root of your repository.

The shared lockfile also means that all the dependencies will be hard linked into one node_modules in the root of the repo and symlinks will be created from that single node_modules into each project of the monorepo.

Bonus advantages of the new config:

  • every dependency is a singleton
  • faster installations in a monorepo
  • less changes in code reviews

How to configure the new config

  1. your monorepo has to have a pnpm-workspace.yaml file in the root
  2. an .npmrc file with the following content should be in the root of the monorepo:
shared-workspace-shrinkwrap = true

; the following is also a nice to have option in a monorepo
; when link-workspace-packages is true, dependencies are linked from the repo, when available
link-workspace-packages = true

Don't miss a new pnpm release

NewReleases is sending notifications on new releases.