Typescript学习笔记——2021
tsconfig.json的使用
编译上下文
tsconfig.json 的作用
- 用于标识 TypeScript 项目的根路径;
- 用于配置 TypeScript 编译器;
- 用于指定编译的文件。
tsconfig.json 重要字段
- files - 设置要编译的文件的名称;
- include - 设置需要进行编译的文件,支持路径模式匹配;
- exclude - 设置无需进行编译的文件,支持路径模式匹配;
- compilerOptions - 设置与编译流程相关的选项。
compilerOptions 选项
compilerOptions 支持很多选项,常见的有 baseUrl
、 target
、 moduleResolution
和 lib
等。
compilerOptions 每个选项的详细说明如下:
{ |