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.

36 lines
1.4 KiB

This file contains ambiguous Unicode characters!

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脚本宿主类型支持
]
}
}