// JavaScript(VitePress前端)项目配置文件
// 详见:https://www.typescriptlang.org/tsconfig/
{
// 编译器设置
"compilerOptions": {
// 严格的类型检查
"strict": false,
// 强制开启JS类型检查
"checkJs": true,
// 开启"use strict"模式
"alwaysStrict": true,
// 跳过node_modules包的类型检查
"skipLibCheck": true,
// 模块系统:输入输出应遵循的模块语法:最新ECMA语法
"module": "esnext",
// 处理模块导入导出解析语法的方式:适用Vite的"bundler"模式
"moduleResolution": "bundler",
// 优化import导入CJS模块
"esModuleInterop": true,
// 支持从JSON文件中导入模块
"resolveJsonModule": true,
// 允许使用import引入CommonJS模块
"allowSyntheticDefaultImports": true,
// 运行时环境兼容:最新的ECMA语法、DOM等
"lib": ["esnext", "dom", "dom.iterable"],
// 路径别名
// 务必记得!编译设置一定要配置路径别名,否则编译器找不到路径
"paths": {
// 把“@”指向源码根目录
"@/*": ["./*"],
}
},
// 编译器类型检查的起始目录
"include": [
// VitePress编译时目录
".vitepress/**/*",
// 网页内容
"index/**/*",
"i18n/**/*",
// 组件库
"components/**/*",
// 脚本库
"utils/**/*",
// 其它类型注释
"global.d.ts",
"vite-env.d.ts"
],
// 起始目录下,排除类型检查的文件及目录
"exclude": [
// Node包
"node_modules/**",
// 输出目录
"dist-*/**",
// 备份目录
"**/backup/**",
// public文件夹
"public/**",
// 各类缓存文件夹
"**/cache/**"
]
}