2024-11-25 14:21:18 +08:00
|
|
|
/**
|
|
|
|
* @link https://www.typescriptlang.org/tsconfig
|
|
|
|
* @link https://cn.vuejs.org/guide/typescript/overview#configuring-tsconfig-json
|
|
|
|
* @link https://cn.vite.dev/guide/features#typescript-compiler-options
|
|
|
|
*/
|
2024-11-21 19:52:07 +08:00
|
|
|
|
2022-04-20 22:40:26 +08:00
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"target": "esnext",
|
2024-11-18 19:40:44 +08:00
|
|
|
"jsx": "preserve",
|
|
|
|
"jsxImportSource": "vue",
|
|
|
|
"lib": ["esnext", "dom"],
|
2022-04-20 22:40:26 +08:00
|
|
|
"useDefineForClassFields": true,
|
2024-11-18 19:40:44 +08:00
|
|
|
"experimentalDecorators": true,
|
2024-11-19 18:18:03 +08:00
|
|
|
// baseUrl 用来告诉编译器到哪里去查找模块,使用非相对模块时必须配置此项
|
2024-11-18 19:40:44 +08:00
|
|
|
"baseUrl": ".",
|
2022-04-20 22:40:26 +08:00
|
|
|
"module": "esnext",
|
2023-12-12 19:01:25 +08:00
|
|
|
"moduleResolution": "bundler",
|
2024-11-27 17:14:54 +08:00
|
|
|
// 非相对模块导入的路径映射配置,根据 baseUrl 配置进行路径计算,与 vite.config 中 alias 配置同步
|
2024-11-27 10:09:14 +08:00
|
|
|
"paths": {
|
|
|
|
"@/*": ["src/*"],
|
|
|
|
"@@/*": ["src/common/*"]
|
|
|
|
},
|
2022-04-20 22:40:26 +08:00
|
|
|
"resolveJsonModule": true,
|
2024-11-19 18:18:03 +08:00
|
|
|
"types": ["vite/client", "element-plus/global"],
|
2024-12-13 19:01:50 +08:00
|
|
|
// 允许导入 .ts .mts .tsx 拓展名的文件
|
|
|
|
"allowImportingTsExtensions": true,
|
2024-11-21 14:44:19 +08:00
|
|
|
// 允许 JS
|
|
|
|
"allowJs": true,
|
2024-11-19 18:18:03 +08:00
|
|
|
// TS 严格模式
|
2024-11-18 19:40:44 +08:00
|
|
|
"strict": true,
|
|
|
|
"importHelpers": true,
|
2024-12-13 19:01:50 +08:00
|
|
|
// 不输出任何编译后的文件,只进行类型检查
|
|
|
|
"noEmit": true,
|
2024-11-18 19:40:44 +08:00
|
|
|
"sourceMap": true,
|
|
|
|
"allowSyntheticDefaultImports": true,
|
|
|
|
"esModuleInterop": true,
|
|
|
|
"isolatedModules": true,
|
|
|
|
"skipLibCheck": true
|
2022-04-20 22:40:26 +08:00
|
|
|
},
|
2024-11-21 19:52:07 +08:00
|
|
|
// 需要被编译的文件列表
|
2024-11-27 10:09:14 +08:00
|
|
|
"include": ["**/*.ts", "**/*.tsx", "**/*.vue", "**/*.d.ts"],
|
2024-11-21 19:52:07 +08:00
|
|
|
// 从编译中排除的文件列表
|
2022-10-18 15:07:42 +08:00
|
|
|
"exclude": ["node_modules", "dist"]
|
2022-04-20 23:48:58 +08:00
|
|
|
}
|