xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

tsconfig compiler options include & exclude All In One

tsconfig compiler options include & exclude All In One

tsconfig.json

include & exclude

image

https://www.typescriptlang.org/tsconfig#include

Specifies an array of filenames or patterns that should be skipped when resolving include.

指定解析包含时应跳过的文件名或模式数组。

PS: exclude 对 node_modules 文件夹下的 ts 文件类型检查无效,需要使用 skipLibCheck

image

https://www.typescriptlang.org/tsconfig#exclude

type-include & type-exclude

https://www.typescriptlang.org/tsconfig#type-include

https://www.typescriptlang.org/tsconfig#type-exclude

demos

{
  "compilerOptions": {
    "module": "CommonJS",
    // "module": "commonjs",
    // "module": "umd",
    // "module": "amd",
    // "module": "es6",
    // "target": "es6",
    "target": "es5",
    // "target": "es3",
    "sourceMap": true,
    "sourceRoot": "./src",
    "baseUrl": "./src",
    "outDir": "./dist/",
    "locale": "zh-CN",
    "noImplicitAny": true,
    "allowJs": true,
    "declaration": true,
    "declarationDir": "./types",
    "declarationMap": true,
    "skipLibCheck": true
  },
  "type": "module",
  "include": [
    // include folder ✅
    "src/**/*",
  ],
  "exclude": [
    "node_modules",
    "types",
    "build",
    "dist",
    "build",
    "000-xyz/**/*",
    "test/**/*.spec.ts"
  ]
}

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs

skipLibCheck

https://www.typescriptlang.org/tsconfig#skipLibCheck



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


template

posted @ 2023-03-11 12:13  xgqfrms  阅读(61)  评论(0编辑  收藏  举报