diff options
| author | pany <[email protected]> | 2022-04-21 12:05:43 +0800 |
|---|---|---|
| committer | pany <[email protected]> | 2022-04-21 12:05:43 +0800 |
| commit | 09f941a7b71b979afede6c077b89f1ff6d2691f2 (patch) | |
| tree | 3775630af28fae0773147de384669755f93456d3 /tsconfig.json | |
| parent | 653cfdf8ba6101953bc4363ee41aed00cff43095 (diff) | |
chore: ts 配置
Diffstat (limited to 'tsconfig.json')
| -rw-r--r-- | tsconfig.json | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tsconfig.json b/tsconfig.json index 85b1e03..062d523 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,8 +5,12 @@ "useDefineForClassFields": true, "module": "esnext", "moduleResolution": "node", + /** ts 严格模式 */ "strict": true, "jsx": "preserve", + "importHelpers": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, "sourceMap": true, "resolveJsonModule": true, /** https://vitejs.cn/guide/features.html#typescript-compiler-options */ @@ -17,12 +21,19 @@ "dom" ], "skipLibCheck": true, - "types": ["vite/client"], + "types": [ + "node", + "vite/client", + /** element-plus 的 volar 插件支持 */ + // "element-plus/global" + ], /** baseUrl 用来告诉编译器到哪里去查找模块,使用非相对模块时必须配置此项 */ "baseUrl": ".", - // 非相对模块导入的路径映射配置,根据 baseUrl 配置进行路径计算 + /** 非相对模块导入的路径映射配置,根据 baseUrl 配置进行路径计算 */ "paths": { - "@/*": ["src/*"] + "@/*": [ + "src/*" + ] }, }, "include": [ @@ -30,6 +41,12 @@ "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", + "types/**/*.d.ts", "vite.config.ts" + ], + /** 编译器默认排除的编译文件 */ + "exclude": [ + "node_modules", + "dist" ] } |
