Pardon my ignorance, if I am developing a library, should (some of) my peerDependencies
be duplicated in my devDependencies
? I'm thinking yes, right?
Example:
"peerDependencies": {
"@babel/runtime": "7.6.0", <- needed for consuming the transpiled library
"sugar-date": "2.0.6",
"yup": "0.27.0"
},
"devDependencies": {
"sugar-date": "2.0.6", <- this is actually a "dependency"
"yup": "0.27.0", <- this is actually a "dependency"
...
}
Because this is a library, if I put them as dependencies, then in the project that consumes them, they will install their own node_modules when the project might already contain these dependencies, resulting in duplicated code - so I put them in peerDependencies
to avoid this. But now I can't develop (e.g. write tests), so I have to put them in devDependencies
.
Is this correct? Am I misunderstanding something?