Skip to content

Commit 57916a4

Browse files
authored
fix: add @types/node as an optional peer dependency (#10757)
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.
1 parent 1f57f84 commit 57916a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/vite/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,17 @@
123123
"ws": "^8.10.0"
124124
},
125125
"peerDependencies": {
126+
"@types/node": ">= 14",
126127
"less": "*",
127128
"sass": "*",
128129
"stylus": "*",
129130
"sugarss": "*",
130131
"terser": "^5.4.0"
131132
},
132133
"peerDependenciesMeta": {
134+
"@types/node": {
135+
"optional": true
136+
},
133137
"sass": {
134138
"optional": true
135139
},

0 commit comments

Comments
 (0)