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:
czlonkowski
2025-07-30 10:18:29 +02:00
parent ee9efd7849
commit bd208e71f8

View File

@@ -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"]
} }