[Typescript] tsconfig libs and target

In tsconfig file, you have targetand libsconfiguration.

You always need to define a target, recommended as es2022

Specifying the lib option also lets us drill down into the specific features and libraries we want to include in our project, which we will see more of later.

{
  "compilerOptions": {
    "target": "ES2022",
    "lib": ["ES2022" , "ESNext.Intl"],
    // rest of config as before

 

Without libs, by default, it includes["DOM", "DOM.Iterable"]as well, if you give libswith some values, the default values will be replaced

posted @ 2024-08-08 19:01  Zhentiw  阅读(21)  评论(0)    收藏  举报