Skip to content

Commit

Permalink
docs: override vite/client type (#9488)
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
  • Loading branch information
sapphi-red and bluwy authored Aug 2, 2022
1 parent 937cecc commit 1983cf4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/guide/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ This will provide the following type shims:
- Types for the Vite-injected [env variables](./env-and-mode#env-variables) on `import.meta.env`
- Types for the [HMR API](./api-hmr) on `import.meta.hot`

::: tip
To override the default typing, declare it before the triple-slash reference. For example, to make the default import of `*.svg` a React component:

```ts
declare module '*.svg' {
const content: React.FC<React.SVGProps<SVGElement>>
export default content
}

/// <reference types="vite/client" />
```

:::

## Vue

Vite provides first-class Vue support:
Expand Down

0 comments on commit 1983cf4

Please sign in to comment.