{ "compilerOptions": { "target": "ESNext", // 目标语言的版本 "useDefineForClassFields": true, //发出符合ECMAScript标准的类字段 "module": "ESNext", // 生成代码的模板标准 "moduleResolution": "Node", //指定TypeScript如何从给定的模块说明符中查找文件 "strict": true, // 开启所有严格的类型检查 "jsx": "preserve", //指定生成什么JSX代码。 "resolveJsonModule": true, //是否解析 JSON 模块 "isolatedModules": true, // 确保每个文件都可以安全地转译,而不依赖于其他导入。 "esModuleInterop": true, // 发出额外的JavaScript以简化对导入Common/S模块的支持。这使得allowsyntheticdefaulultimports类型兼容。 "removeComments": true, // 删除注释 "types": ["@dcloudio/types"], "paths": { "@/*": ["./src/*"] }, //指定一组条目,它们将导入重新映射到其他查找位置。 "lib": ["ESNext", "DOM"], // TS需要引用的库 "skipLibCheck": true, // 跳过所有.d.ts文件的类型检查 "noEmit": true, // 从编译中禁用发射文件。 "noEmitOnError": true, //有错误时不进行编译 "forceConsistentCasingInFileNames": true, //是否区分文件系统大小写规则 "experimentalDecorators": true, //是否启用对装饰器的实验性支持,装饰器是一种语言特性,还没有完全被 JavaScript 规范批准 "emitDecoratorMetadata": true //为装饰器启用对发出类型元数据的实验性支持 }, "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], "references": [{ "path": "./tsconfig.node.json" }] // 引用的项目。要求TypeScript 3.0或更高版本。 }