fix: override test-related types in tsconfig.build.json for Docker builds
- Override the 'types' array to only include 'node' types - Exclude 'types' directory and any nested types directories from build - Add comment explaining the types override rationale - This prevents TypeScript from looking for vitest/globals and test-env types The issue was that tsconfig.build.json was inheriting test-related type definitions from tsconfig.json which aren't available in the minimal Docker build environment. Code reviewed and enhanced based on suggestions: - Added '**/types' to exclude pattern for comprehensive exclusion - Added explanatory comment for future maintainers 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src"
|
"rootDir": "./src",
|
||||||
|
// Override parent's types to exclude test-related types for production builds
|
||||||
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*"],
|
||||||
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts", "tests"]
|
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts", "tests", "types", "**/types"]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user