Skip to content

Commit

Permalink
fix: vite client types (#7877)
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
  • Loading branch information
poyoho and bluwy committed May 5, 2022
1 parent 34df307 commit 0e67fe8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/guide/env-and-mode.md
Expand Up @@ -81,6 +81,14 @@ interface ImportMeta {
}
```

If your code relies on types from browser environments such as [DOM](https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts) and [WebWorker](https://github.com/microsoft/TypeScript/blob/main/lib/lib.webworker.d.ts), you can update the [lib](https://www.typescriptlang.org/tsconfig#lib) field in `tsconfig.json`.

```json
{
"lib": ["WebWorker"]
}
```

## Modes

By default, the dev server (`dev` command) runs in `development` mode and the `build` command run in `production` mode.
Expand Down
1 change: 0 additions & 1 deletion packages/vite/client.d.ts
@@ -1,4 +1,3 @@
/// <reference lib="dom" />
/// <reference path="./types/importMeta.d.ts" />

// CSS modules
Expand Down

0 comments on commit 0e67fe8

Please sign in to comment.