From 22896e4dd1f7815a6ae406728f674ae0007d804d Mon Sep 17 00:00:00 2001 From: yoho Date: Thu, 5 May 2022 22:51:55 +0800 Subject: [PATCH] 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.