Skip to content

Commit 40a0847

Browse files
authored
refactor: typecheck client directory (#22284)
1 parent 5c7cec6 commit 40a0847

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"build-types": "pnpm build-types-roll && pnpm build-types-check",
6666
"build-types-roll": "rolldown --config rolldown.dts.config.ts",
6767
"build-types-check": "tsc --project tsconfig.check.json",
68-
"typecheck": "tsc && tsc -p src/node && tsc -p src/module-runner && tsc -p src/shared && tsc -p src/node/__tests_dts__ && tsc -p src/module-runner/__tests_dts__",
68+
"typecheck": "tsc && tsc -p src/node && tsc -p src/client && tsc -p src/module-runner && tsc -p src/shared && tsc -p src/node/__tests_dts__ && tsc -p src/module-runner/__tests_dts__",
6969
"lint": "eslint --cache --ext .ts src/**",
7070
"format": "oxfmt",
7171
"generate-target": "tsx scripts/generateTarget.ts",

packages/vite/src/client/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { nanoid } from 'nanoid/non-secure'
12
import type {
23
DevRuntime as DevRuntimeType,
34
Messenger,
@@ -12,6 +13,7 @@ import {
1213
import { createHMRHandler } from '../shared/hmrHandler'
1314
import { setupForwardConsoleHandler } from '../shared/forwardConsole'
1415
import { ErrorOverlay, cspNonce, overlayId } from './overlay'
16+
// @ts-expect-error internal virtual module
1517
import '@vite/env'
1618

1719
// injected by the hmr plugin when served
@@ -659,7 +661,9 @@ if (isBundleMode && typeof DevRuntime !== 'undefined') {
659661
}
660662
},
661663
}
664+
const clientId = nanoid()
662665
;(globalThis as any).__rolldown_runtime__ ??= new ViteDevRuntime(
663666
wrappedSocket,
667+
clientId,
664668
)
665669
}

0 commit comments

Comments
 (0)