{ // tsconfig.base.json,用于被 tesconfig.json 和 tesconfig.build.json 继承 "compilerOptions": { // 输出模块语法,使用版本号最新的那个,而不是实验性语法 ESNext "module": "es2022", // 模块解析策略,模拟 Vite / Rollup / webpack,支持 exports / imports,不强制 Node ESM 的严格规则 "moduleResolution": "bundler", // 显式声明使用的类型包 "types": ["node", "react", "react-dom"], // 允许 ESM 导入 CJS "esModuleInterop": true, // 跳过 node_modules 类型检查,加快构建,避免第三方类型污染 "skipLibCheck": true, /** * 只做类型检查,不生成 JS 输出 * - 适用于 Vite / Next / Nuxt 等 bundler 场景 * - 防止 tsc 与构建工具重复 emit */ "noEmit": true } }