Skip to content

Commit

Permalink
fix: add @types/node as an optional peer dependency (#10757)
Browse files Browse the repository at this point in the history
The built bundle of Vite starts with a reference to `node` types:
https://unpkg.com/browse/vite@3.2.2/dist/node/index.d.ts

This means those who depend on Vite type definitions should install
`@types/node` in their projects to successfully do type-checking.
In that sense, `@types/node` is an optional peer dependency of Vite.

After this being fixed, we should revert vitejs/vite-ecosystem-ci#85 because not explicitly depending on
`@types/node` *should* be erroneous. The ecosystem CI shouldn't cover
that error for downstream packages.
  • Loading branch information
haoqunjiang authored Nov 4, 2022
1 parent 1f57f84 commit 57916a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,17 @@
"ws": "^8.10.0"
},
"peerDependencies": {
"@types/node": ">= 14",
"less": "*",
"sass": "*",
"stylus": "*",
"sugarss": "*",
"terser": "^5.4.0"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
},
"sass": {
"optional": true
},
Expand Down

0 comments on commit 57916a4

Please sign in to comment.