Closed joshwilsonvu closed 4 years ago
Thank you for explaining the issue so clearly and even presenting me with a solution.
I’m merging this because it resolve an important issue and it is non-breaking.
However, I’m surprised to discover that browserslist
is a peerDependencies
since it explicitly uses it. Do you suppose that package should change browserslist
to a dependency
?
They certainly could, but a peer dependency lets their package work with whatever version the end user or a dependent package decides to install. Just a matter of taste I suppose.
Hello,
When installing a dependent of this package with Yarn 2, I got log output pointing out that this package has a missing peer dependency
browserslist
, becausepostcss-browser-comments
has a peer dependency on it. More info here.Unfortunately, this isn't just a warning; Yarn 2 Plug 'n Play throws an error when
postcss-browser-comments
attempts to requirebrowserslist
, even if the top-level project hasbrowserslist
installed.Adding
browserslist
topeerDependencies
makes the intended behavior here explicit and resolves the installation warning and runtime exception. It will not be a breaking change as npm and Yarn 1 already surface a peer dependency warning frompostcss-browser-comments
.