Skip to content

Commit 693bb3d

Browse files
docs: clarify package.json override value specs (#9508)
Backport of #9505 to `release/v11`. Co-authored-by: ded-furby <190979964+ded-furby@users.noreply.github.com>
1 parent ccffe4a commit 693bb3d

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docs/lib/content/configuring-npm/package-json.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,21 @@ To make sure the package `@npm/foo` is always installed as version `1.0.0` no ma
884884
}
885885
```
886886

887+
Override values can use any specifier that npm accepts for dependencies, including
888+
an exact version, a semver range, a dist-tag, or a replacement specifier such as
889+
`npm:`, `file:`, or a Git URL.
890+
891+
For example, if you only need to enforce a minimum patched release instead of one
892+
exact version, you can use a semver range:
893+
894+
```json
895+
{
896+
"overrides": {
897+
"@npm/foo": "^1.0.0"
898+
}
899+
}
900+
```
901+
887902
The above is a short hand notation, the full object form can be used to allow overriding a package itself as well as a child of the package.
888903
This will cause `@npm/foo` to always be `1.0.0` while also making `@npm/bar` at any depth beyond `@npm/foo` also `1.0.0`:
889904

0 commit comments

Comments
 (0)