Update tsconfig: bundler resolution & path mappings
Switch moduleResolution to "bundler" in base and package tsconfigs and consolidate path aliases for monorepo packages. Remove several package-level baseUrl entries and update package paths to reference ../../packages/* (add explicit napcat-common/src and napcat-image-size/src mappings). Also add a rootDir override for napcat-core. These changes unify module resolution and path aliases so TypeScript and bundlers resolve workspace packages consistently.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2021",
|
"target": "ES2021",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "bundler",
|
||||||
"lib": [
|
"lib": [
|
||||||
"ES2021"
|
"ES2021"
|
||||||
],
|
],
|
||||||
@@ -34,10 +34,15 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
|
"napcat-common/src/*": [
|
||||||
|
"../../packages/napcat-common/src/*"
|
||||||
|
],
|
||||||
|
"napcat-image-size/src/*": [
|
||||||
|
"../../packages/napcat-image-size/src/*"
|
||||||
|
],
|
||||||
"@/*": [
|
"@/*": [
|
||||||
"../*"
|
"../../packages/*"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "bundler",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2021",
|
"target": "ES2021",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "bundler",
|
||||||
"lib": [
|
"lib": [
|
||||||
"ES2021"
|
"ES2021"
|
||||||
],
|
],
|
||||||
@@ -34,7 +34,6 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"baseUrl": ".",
|
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"skipDefaultLibCheck": true
|
"skipDefaultLibCheck": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,10 +4,9 @@
|
|||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": [
|
"@/*": [
|
||||||
"../*/"
|
"../../packages/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"rootDir": "..",
|
"rootDir": "..",
|
||||||
"baseUrl": ".",
|
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"emitDeclarationOnly": true,
|
"emitDeclarationOnly": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
@@ -11,25 +10,31 @@
|
|||||||
"noEmitOnError": false,
|
"noEmitOnError": false,
|
||||||
"paths": {
|
"paths": {
|
||||||
"napcat-core": [
|
"napcat-core": [
|
||||||
"../napcat-core/index.ts"
|
"../../packages/napcat-core/index.ts"
|
||||||
],
|
],
|
||||||
"napcat-onebot": [
|
"napcat-onebot": [
|
||||||
"../napcat-onebot/index.ts"
|
"../../packages/napcat-onebot/index.ts"
|
||||||
|
],
|
||||||
|
"napcat-common/src/*": [
|
||||||
|
"../../packages/napcat-common/src/*"
|
||||||
|
],
|
||||||
|
"napcat-image-size/src/*": [
|
||||||
|
"../../packages/napcat-image-size/src/*"
|
||||||
],
|
],
|
||||||
"@/napcat-core/*": [
|
"@/napcat-core/*": [
|
||||||
"../napcat-core/*"
|
"../../packages/napcat-core/*"
|
||||||
],
|
],
|
||||||
"@/napcat-onebot/*": [
|
"@/napcat-onebot/*": [
|
||||||
"../napcat-onebot/*"
|
"../../packages/napcat-onebot/*"
|
||||||
],
|
],
|
||||||
"@/napcat-common/*": [
|
"@/napcat-common/*": [
|
||||||
"../napcat-common/*"
|
"../../packages/napcat-common/*"
|
||||||
],
|
],
|
||||||
"@/napcat-webui-backend/*": [
|
"@/napcat-webui-backend/*": [
|
||||||
"../napcat-webui-backend/*"
|
"../../packages/napcat-webui-backend/*"
|
||||||
],
|
],
|
||||||
"@/*": [
|
"@/*": [
|
||||||
"../*"
|
"../../packages/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+53
-3
@@ -2,7 +2,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2021",
|
"target": "ES2021",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "bundler",
|
||||||
"lib": [
|
"lib": [
|
||||||
"ES2021"
|
"ES2021"
|
||||||
],
|
],
|
||||||
@@ -30,10 +30,60 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
|
"napcat-core": [
|
||||||
|
"./packages/napcat-core/index.ts"
|
||||||
|
],
|
||||||
|
"napcat-core/*": [
|
||||||
|
"./packages/napcat-core/*"
|
||||||
|
],
|
||||||
|
"napcat-onebot": [
|
||||||
|
"./packages/napcat-onebot/index.ts"
|
||||||
|
],
|
||||||
|
"napcat-onebot/*": [
|
||||||
|
"./packages/napcat-onebot/*"
|
||||||
|
],
|
||||||
|
"napcat-common": [
|
||||||
|
"./packages/napcat-common/src/index.ts"
|
||||||
|
],
|
||||||
|
"napcat-common/src/*": [
|
||||||
|
"./packages/napcat-common/src/*"
|
||||||
|
],
|
||||||
|
"napcat-image-size": [
|
||||||
|
"./packages/napcat-image-size/src/index.ts"
|
||||||
|
],
|
||||||
|
"napcat-image-size/src/*": [
|
||||||
|
"./packages/napcat-image-size/src/*"
|
||||||
|
],
|
||||||
|
"napcat-database": [
|
||||||
|
"./packages/napcat-database/src/index.ts"
|
||||||
|
],
|
||||||
|
"napcat-database/src/*": [
|
||||||
|
"./packages/napcat-database/src/*"
|
||||||
|
],
|
||||||
|
"napcat-protocol": [
|
||||||
|
"./packages/napcat-protocol/index.ts"
|
||||||
|
],
|
||||||
|
"napcat-protocol/*": [
|
||||||
|
"./packages/napcat-protocol/*"
|
||||||
|
],
|
||||||
|
"napcat-qrcode": [
|
||||||
|
"./packages/napcat-qrcode/index.ts"
|
||||||
|
],
|
||||||
|
"napcat-qrcode/*": [
|
||||||
|
"./packages/napcat-qrcode/*"
|
||||||
|
],
|
||||||
|
"napcat-webui-backend": [
|
||||||
|
"./packages/napcat-webui-backend/index.ts"
|
||||||
|
],
|
||||||
|
"napcat-webui-backend/*": [
|
||||||
|
"./packages/napcat-webui-backend/*"
|
||||||
|
],
|
||||||
|
"napcat-pty": [
|
||||||
|
"./packages/napcat-pty/node-pty.d.ts"
|
||||||
|
],
|
||||||
"@/*": [
|
"@/*": [
|
||||||
"packages/*"
|
"./packages/*"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user