Skip to content

Commit f6fff32

Browse files
xuhdevwraithgar
andauthored
docs: clarify what peerDependenciesMeta does (#7433)
Co-authored-by: Gar <wraithgar@github.com>
1 parent 796971e commit f6fff32

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

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

+5-9
Original file line numberDiff line numberDiff line change
@@ -818,11 +818,12 @@ to express this. If you depend on features introduced in 1.5.2, use
818818

819819
### peerDependenciesMeta
820820

821-
When a user installs your package, npm will emit warnings if packages
822-
specified in `peerDependencies` are not already installed. The
823-
`peerDependenciesMeta` field serves to provide npm more information on how
821+
The `peerDependenciesMeta` field serves to provide npm more information on how
824822
your peer dependencies are to be used. Specifically, it allows peer
825-
dependencies to be marked as optional.
823+
dependencies to be marked as optional. Npm will not automatically install
824+
optional peer dependencies. This allows you to
825+
integrate and interact with a variety of host packages without requiring
826+
all of them to be installed.
826827

827828
For example:
828829

@@ -842,11 +843,6 @@ For example:
842843
}
843844
```
844845

845-
Marking a peer dependency as optional ensures npm will not emit a warning
846-
if the `soy-milk` package is not installed on the host. This allows you to
847-
integrate and interact with a variety of host packages without requiring
848-
all of them to be installed.
849-
850846
### bundleDependencies
851847

852848
This defines an array of package names that will be bundled when publishing

0 commit comments

Comments
 (0)