From 57916a476924541dd7136065ceee37ae033ca78c Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 4 Nov 2022 13:43:19 +0800 Subject: [PATCH] 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 https://github.com/vitejs/vite-ecosystem-ci/pull/85 because not explicitly depending on `@types/node` *should* be erroneous. The ecosystem CI shouldn't cover that error for downstream packages. --- packages/vite/package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vite/package.json b/packages/vite/package.json index 2d07009b411dcc..54e5340bb99080 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -123,6 +123,7 @@ "ws": "^8.10.0" }, "peerDependencies": { + "@types/node": ">= 14", "less": "*", "sass": "*", "stylus": "*", @@ -130,6 +131,9 @@ "terser": "^5.4.0" }, "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, "sass": { "optional": true },