Created
February 25, 2022 11:51
-
-
Save Debbl/5c7281c3845449e758622d8c61820430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
// 目标代码 esnext 是指 es6 以后 | |
// 交给 Babel 来转化 根据 browserslistrc | |
"target": "esnext", | |
// 目标代码使用的模块化方案 umd 支持多种模块化 | |
"module": "esnext", | |
// 严格模式 'use strict' | |
"strict": true, | |
// 对 jsx 进行怎么样的处理 preserve 保持默认 | |
"jsx": "preserve", | |
// 辅助的导入功能 | |
"importHelpers": true, | |
// 按照 node 的方式去解析模块 import 'index' 加 .js | |
"moduleResolution": "node", | |
// 跳过对一些库的类型检测 对一些第三方库不检测类型 可以避免同名类型等等 | |
"skipLibCheck": true, | |
// export default / module.exports 是否可以混合使用 | |
"esModuleInterop": true, | |
"allowSyntheticDefaultImports": true, | |
"forceConsistentCasingInFileNames": true, | |
"useDefineForClassFields": true, | |
// 要不要生成映射文件 ts -> js | |
"sourceMap": true, | |
// 文件路径解析的基本 url | |
"baseUrl": ".", | |
// 指定具体要解析使用的类型 默认可以从 target 看出 | |
"types": [ | |
"webpack-env" | |
], | |
// 路径解析 编译阶段 | |
"paths": { | |
"@/*": [ | |
"src/*" | |
] | |
}, | |
// 指定在项目中可以使用那些库的类型(Proxy / Window / Promise) | |
"lib": [ | |
"esnext", | |
"dom", | |
"dom.iterable", | |
"scripthost" | |
] | |
}, | |
// 有哪些代码需要用 ts 编译解析 使用当前文件 tsconfig.json | |
"include": [ | |
"src/**/*.ts", | |
"src/**/*.tsx", | |
"src/**/*.vue", | |
"tests/**/*.ts", | |
"tests/**/*.tsx" | |
], | |
// 排除文件 排除 include 文件里面引用 node_modules 模块的 | |
"exclude": [ | |
"node_modules" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment