I am writing a react component library, and dont want to bundle react, so I added the libs to peerDependencies rather than dependencies.
Also, to prevent those stupid warnings about missing peerDependencies, I add the same libs to the devDependencies section.
Thats not DRY, but a fixed warning is more important to me than a DRY package.json.
So the question is: Is there a DRYer method to achieve this, or do I actually follow the May 2020 best practice?
{
"peerDependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
"tslib": "^1.11.0",
},
"devDependencies": {
"@types/react": "^16.9.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"typescript": "^3.8.0"
},
"dependencies": {
// nothing here
}
}