Skip to content

Commit cbb6b16

Browse files
committed
docs: make add d.ts default
1 parent aa27d9e commit cbb6b16

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/guide/features.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ Note that because `esbuild` only performs transpilation without type information
3838

3939
### Client Types
4040

41-
Vite's default types are for its Node.js API. To shim the environment of client side code in a Vite application, add `vite/client` to `compilerOptions.types` of your `tsconfig`:
41+
Vite's default types are for its Node.js API. To shim the environment of client side code in a Vite application, add a `d.ts` declaration file:
42+
43+
```typescript
44+
/// <reference types="vite/client" />
45+
```
46+
47+
Also, you can add `vite/client` to `compilerOptions.types` of your `tsconfig`:
4248

4349
```json
4450
{
@@ -48,12 +54,6 @@ Vite's default types are for its Node.js API. To shim the environment of client
4854
}
4955
```
5056

51-
Also, you can add a `d.ts` declaration file:
52-
53-
```typescript
54-
/// <reference types="vite/client" />
55-
```
56-
5757
This will provide the following type shims:
5858

5959
- Asset imports (e.g. importing an `.svg` file)

0 commit comments

Comments
 (0)