Answer the question
In order to leave comments, you need to log in
How does peerDependencies work in package.json?
Can you please explain on your fingers how and why to use peerDependencies on the project? What to write there? I'm trying to understand, but googling it didn't add clarity to me. Do I understand correctly that it is necessary to write there those dependencies that can be intertwined in different commands, so that when building with webpack, it does not duplicate them in the bundle? How does it even work?
Answer the question
In order to leave comments, you need to log in
Not really sure where you found this, but Google can find the answer in less than 10 seconds.
peerDependencies are a special type of dependency that can only occur if you publish your own package.
Having peerDependencies means that your package needs the same dependency as the person installing your package. Used for packages like react that need to have a single copy of react-dom that is also used by the person installing it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question