Skip to content

5.5.0 inheriting outDir: ${configDir} does not automatically exclude it from compilationΒ #58327

Closed
@Knagis

Description

@Knagis

πŸ”Ž Search Terms

configDir

πŸ•— Version & Regression Information

This is likely bug with feature introduced in 5.5.0

⏯ Playground Link

https://github.com/Knagis/importHelpers-5.5.0/tree/exclude-lib

πŸ’» Code

tsconfig.base.json

{
    "compilerOptions": {
        "outDir": "${configDir}/lib",
    },
}

packages/foo/tsconfig.json

{
    "extends": "../../tsconfig.base.json",
    "compilerOptions": {
        "composite": true,
        // "outDir": "lib" // uncomment to make it work
    },
    "include": [
        "**/*.ts"
    ],
}

πŸ™ Actual behavior

When using outDir: "${configDir}/lib" in the base config, compiling this project results in

error TS5055: Cannot write file 'C:/Code/tslibissue/packages/foo/lib/src/index.d.ts' because it would overwrite input file.

πŸ™‚ Expected behavior

Project compiles without errors

Additional information about the issue

If i specify outDir: "lib" or even outDir: "${configDir}/lib" in the derived config, the project compiles without errors as the lib folder seems to be automatically excluded from the compilation.

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions