12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- {
- "compilerOptions": {
- // 目标ES版本,设定为最新的ES标准
- "target": "esnext",
- // 为类的实例字段使用明确的定义(class fields)
- "useDefineForClassFields": true,
- // 指定模块系统,此处使用ES模块
- "module": "esnext",
- // 模块解析策略,采用Node.js的解析规则
- "moduleResolution": "node",
- // 启用所有严格类型检查选项
- "strict": true,
- // 是否排除内置的类型声明文件,默认false包含
- "noLib": false,
- // 生成相应的source map文件,便于调试
- "sourceMap": true,
- // 允许导入JSON模块
- "resolveJsonModule": true,
- // 允许在导入非ES模块时使用默认导入语法
- "esModuleInterop": true,
- // 指定项目中要包含的库文件
- "lib": ["esnext", "dom"],
- // 设置基准目录,相对于tsconfig.json的路径
- "baseUrl": ".",
- // 包含`.js`文件的类型检查
- "allowJs": true,
- // 路径别名,简化导入路径
- "paths": {
- "@/*": ["src/*"]
- },
- // 引入额外的类型声明文件
- "types": [
- "vite/client",
- "unplugin-icons/types/vue",
- "element-plus/global",
- "vite-plugin-svg-icons/client"
- ],
- // 跳过`.d.ts`文件的类型检查,提高编译速度
- "skipLibCheck": true,
- // 允许在没有默认导出的情况下使用默认导入语法
- "allowSyntheticDefaultImports": true,
- // 强制文件名大小写一致性
- "forceConsistentCasingInFileNames": true,
- // JSX编译设置,保留JSX以便在运行时转换
- "jsx": "preserve",
- // 自定义JSX工厂函数
- "jsxFactory": "h",
- // 自定义JSX片段工厂函数
- "jsxFragmentFactory": "Fragment"
- },
- // 指定要包含在编译操作中的文件
- "include": ["src/**/*.ts", "src/**/*.vue", "src/typings/**/*.d.ts", "vite.config.ts"],
- // 排除不希望被编译的文件或目录
- "exclude": ["node_modules", "dist"]
- }
|