You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
{
// 逻辑注释: TypeScript编译器配置 - 定义TypeScript项目的编译选项和路径映射
"compilerOptions" : {
// 目标JavaScript版本: 编译生成的JS代码遵循ES5标准
// 作用: 确保代码在旧浏览器( 如IE11) 中兼容运行
"target" : "es5" ,
// 模块系统: 使用ES模块规范( ESNext表示最新ES模块特性)
// 作用: 生成现代模块语法, 支持tree-shaking优化
"module" : "esnext" ,
// 基础路径:解析非相对模块导入的基准目录
// 作用:所有非相对导入都基于项目根目录进行解析
"baseUrl" : "./" ,
// 模块解析策略: 使用Node.js风格的模块解析
// 作用: 按照Node.js的require()解析规则来查找模块
"moduleResolution" : "node" ,
// 路径映射:配置模块路径别名
// 作用:将@符号映射到src目录, 简化导入路径
"paths" : {
"@/*" : [
"src/*" // 例如: import ... from '@/components/Hello' → src/components/Hello
]
} ,
// 类型定义库:包含编译时可用的类型定义
"lib" : [
"esnext" , // 最新ECMAScript特性类型支持
"dom" , // 浏览器DOM API类型支持
"dom.iterable" , // DOM可迭代对象类型支持( 如NodeList)
"scripthost" // Windows脚本宿主类型支持
]
}
}