From 48d6b782b7aa45f5e36fc0a23ae0e205485aae1f Mon Sep 17 00:00:00 2001 From: yoho Date: Sat, 23 Apr 2022 22:06:53 +0800 Subject: [PATCH 1/3] fix: vite client types --- packages/vite/client.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/vite/client.d.ts b/packages/vite/client.d.ts index aaac1ea986251d..af8e6a6f9d1494 100644 --- a/packages/vite/client.d.ts +++ b/packages/vite/client.d.ts @@ -1,4 +1,3 @@ -/// /// // CSS modules From 22896e4dd1f7815a6ae406728f674ae0007d804d Mon Sep 17 00:00:00 2001 From: yoho Date: Thu, 5 May 2022 22:51:55 +0800 Subject: [PATCH 2/3] docs: tsconfig.json lib --- docs/guide/env-and-mode.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/guide/env-and-mode.md b/docs/guide/env-and-mode.md index b2b1264e85a8e4..47ddc5e30c4fcc 100644 --- a/docs/guide/env-and-mode.md +++ b/docs/guide/env-and-mode.md @@ -81,6 +81,14 @@ interface ImportMeta { } ``` +In order to be compatible with different environments within the browser, Such as [DOM](https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts), [WebWorker](https://github.com/microsoft/TypeScript/blob/main/lib/lib.webworker.d.ts), we should add 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. From 784727b2634cb25257ff72cd6d020efa719c108e Mon Sep 17 00:00:00 2001 From: patak Date: Thu, 5 May 2022 22:26:16 +0200 Subject: [PATCH 3/3] chore: update wording Co-authored-by: Bjorn Lu --- docs/guide/env-and-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/env-and-mode.md b/docs/guide/env-and-mode.md index 47ddc5e30c4fcc..d5f45ea1158808 100644 --- a/docs/guide/env-and-mode.md +++ b/docs/guide/env-and-mode.md @@ -81,7 +81,7 @@ interface ImportMeta { } ``` -In order to be compatible with different environments within the browser, Such as [DOM](https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts), [WebWorker](https://github.com/microsoft/TypeScript/blob/main/lib/lib.webworker.d.ts), we should add the [lib](https://www.typescriptlang.org/tsconfig#lib) field in `tsconfig.json`. +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 {