diff --git a/docs/guide/features.md b/docs/guide/features.md index f32da8d1c42d42..9ca69de24ea78a 100644 --- a/docs/guide/features.md +++ b/docs/guide/features.md @@ -113,16 +113,22 @@ This will provide the following type shims: - 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: +To override the default typing, add a type definition file that contains your typings. Then, add the type reference before `vite/client`. -```ts -declare module '*.svg' { - const content: React.FC> - export default content -} +For example, to make the default import of `*.svg` a React component: -/// -``` +- `vite-env-override.d.ts` (the file that contains your typings): + ```ts + declare module '*.svg' { + const content: React.FC> + export default content + } + ``` +- The file containing the reference to `vite/client`: + ```ts + /// + /// + ``` :::