tsconfig.json
Rama main · réplica de lectura del repositorio original.
{
"compilerOptions": {
"esModuleInterop": true,
"target": "es2022",
"lib": ["es2022","dom"],
"module": "commonjs",
"useUnknownInCatchVariables": false,
"allowJs": true,
/* 方便调试,生成对应的js和ts对应的map文件*/
"sourceMap": true,
"outDir": "./build/server",
"removeComments": true,
"strict": false,
"strictNullChecks": false,
"noUnusedLocals": false,
"moduleResolution": "node10",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noImplicitAny": false,
"stripInternal": true,
"pretty": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": false,
"strictPropertyInitialization": false,
"skipLibCheck": true,
"jsx": "react",
"resolveJsonModule": true,
"incremental": true,
// office 系列包是纯 ESM 且用 exports 子路径导出,node10 解析不到;
// 这里用 paths 精确映射到类型文件,避免为几个包改全局 moduleResolution
"baseUrl": ".",
"paths": {
"@office-kit/xlsx/io": ["node_modules/@office-kit/xlsx/dist/io/index.d.ts"],
"@office-kit/xlsx/node": ["node_modules/@office-kit/xlsx/dist/node.d.ts"]
}
},
"include": [
// "libs",
// "src"
"src/common",
"src/main",
// 前端目录一并纳入:项目大量使用 `import X from "cjs包"` 的默认导入,
// 需要 esModuleInterop 才不报 TS1259;webpack 走 babel 不读 tsconfig,
// 纳入后不影响打包,只是让编辑器的类型检查拿到正确配置。
"src/web"
],
"exclude": [
"build",
"node_modules",
// 第三方 RDP 客户端库(老式八进制字面量等),不参与检查
"src/web/project/component/proxy/rdp/client/js"
]
}