Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
docs: make add d.ts default
  • Loading branch information
fi3ework committed May 22, 2021
commit cbb6b16bcf46811b0fdd59e8428330159457f0fe
14 changes: 7 additions & 7 deletions docs/guide/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ Note that because `esbuild` only performs transpilation without type information

### Client Types

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`:
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:

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

Also, you can add `vite/client` to `compilerOptions.types` of your `tsconfig`:

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

Also, you can add a `d.ts` declaration file:

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

This will provide the following type shims:

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