mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-23 23:29:17 -05:00
feat: merge manifest resolutions and pnpm.overrides (#7174)
* feat: merge manifest `resolutions` and `pnpm.overrides` As someone currently migrating from Yarn, I would find it extremely helpful to be able to give Yarn and pnpm different override instructions. By merging these two, migration from Yarn is even easier, because you can fix pnpm-specific overrides inside `pnpm.overrides` without affecting the existing Yarn setup. * style: make changeset just one line * Update .changeset/twenty-walls-sit.md --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
6
.changeset/twenty-walls-sit.md
Normal file
6
.changeset/twenty-walls-sit.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/config": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Instead of `pnpm.overrides` replacing `resolutions`, the two are now merged. This is intended to make it easier to migrate from Yarn by allowing one to keep using `resolutions` for Yarn, but adding additional changes just for pnpm using `pnpm.overrides`.
|
||||
@@ -26,7 +26,10 @@ export function getOptionsFromRootManifest (manifestDir: string, manifest: Proje
|
||||
// so we cannot call it resolutions
|
||||
const overrides = mapValues(
|
||||
createVersionReferencesReplacer(manifest),
|
||||
manifest.pnpm?.overrides ?? manifest.resolutions ?? {}
|
||||
{
|
||||
...manifest.resolutions,
|
||||
...manifest.pnpm?.overrides,
|
||||
}
|
||||
)
|
||||
const neverBuiltDependencies = manifest.pnpm?.neverBuiltDependencies
|
||||
const onlyBuiltDependencies = manifest.pnpm?.onlyBuiltDependencies
|
||||
|
||||
Reference in New Issue
Block a user