-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Description
Repro
- Bug repro :
npm install @babylonjs/inspector && npm ls @types/react - Expected result:
└── (empty) - Current result:
└─┬ @babylonjs/inspector@5.44.0
├─┬ @babylonjs/gui-editor@5.27.0
│ └── @types/react@18.0.21 deduped
├─┬ @types/react-dom@18.0.6
│ └── @types/react@18.0.21 deduped
└── @types/react@18.0.21
npm 8.19.3
Additional context
Installing react types creates big problems in projects using typescript and non-react frameworks like vue. See e.g. vuejs/language-tools#592
These package are distributed as a pre-built bundles with the main and module fields pointing to dist files, so there's no need to include build-time dependencies, but npm installs these because they are listed as peer dependencies:
Babylon.js/packages/public/@babylonjs/inspector/package.json
Lines 24 to 33 in d521fd0
| "peerDependencies": { | |
| "@babylonjs/core": "^5.22.0", | |
| "@babylonjs/gui": "^5.22.0", | |
| "@babylonjs/gui-editor": "^5.22.0", | |
| "@babylonjs/loaders": "^5.22.0", | |
| "@babylonjs/materials": "^5.22.0", | |
| "@babylonjs/serializers": "^5.22.0", | |
| "@types/react": ">=16.7.3", | |
| "@types/react-dom": ">=16.0.9" | |
| }, |
Moving both @types/react and @types/react-dom from peerDependencies to devDependencies in these two packages would resolve the issue
Reactions are currently unavailable