Open nstuyvesant opened 1 year ago
@woodybriggs report on the same issue from #2706:
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependenciesmeta
peerDependenciesMeta offers the ability for library authors to specify if a peerDependant is optional or not. Currently stackblitz forces installation of peerDependants even if they are marked as optional in peerDependenciesMeta
For a minimal repoduction of this.
Start with: React Typescript Starter
Try add package: @tanstack/react-query
Note after installation message appears: UNMET PEER DEPENDENCIES react-native @ *
"peerDependenciesMeta": { "react-dom": { "optional": true }, "react-native": { "optional": true } }
Description of Bug
StackBlitz forces the user to install all peerDependencies even if they were marked optional using peerDependenciesMeta in the package.json.
For example,
@carbon/styles
has the following in its package.json...Steps to Reproduce
For this StackBlitz example, https://stackblitz.com/edit/2njdn4?file=index.js, if you try to delete
sass
fromDependencies
or package.json, StackBlitz will still force you to installsass
. As a result, the examples take more time to load because they are loading an unnecessary dependency (given that I am only using CSS from that module and not SCSS).Expected Behavior
StackBlitz would allow me to delete optional peer dependencies (or not include them in the first place).
Screenshots/Screencast