Skip to content

Commit 367cec1

Browse files
appsforartistspatak-devsapphi-red
authored
docs: add warning about overriding tsconfig types (#14861)
Co-authored-by: patak <[email protected]> Co-authored-by: sapphi-red <[email protected]>
1 parent b44e3d4 commit 367cec1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/guide/features.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,18 @@ Alternatively, you can add `vite/client` to `compilerOptions.types` inside `tsco
129129
```json [tsconfig.json]
130130
{
131131
"compilerOptions": {
132-
"types": ["vite/client"]
132+
"types": ["vite/client", "some-other-global-lib"]
133133
}
134134
}
135135
```
136136

137-
This will provide the following type shims:
137+
::: warning
138+
139+
If [`compilerOptions.types`](https://www.typescriptlang.org/tsconfig#types) is specified, only these packages will be included in the global scope (instead of all visible ”@types” packages).
140+
141+
:::
142+
143+
`vite/client` provides the following type shims:
138144

139145
- Asset imports (e.g. importing an `.svg` file)
140146
- Types for the Vite-injected [constant variables](./env-and-mode#env-variables) on `import.meta.env`

0 commit comments

Comments
 (0)