Skip to content

Incorrect place of tsbuildinfo file when rootDir option is specified #30925

Closed
@ikokostya

Description

@ikokostya

TypeScript Version: 3.5.0-dev.20190413, 3.4.3

Search Terms:

tsbuildinfo, incremental build, rootDir

Code

For reproduce test project https://github.com/ikokostya/ts-bugs can be used:

git clone https://github.com/ikokostya/ts-bugs
cd ts-bugs
npm install
npx tsc

The test project has the following file structure:

src/
    lib/
        foo.ts
    tests/
        foo.test.ts
tsconfig.json

tsconfig.json content:

{
    "compilerOptions": {
        "module": "commonjs",
        "moduleResolution": "node",
        "target": "es2017",
        "lib": ["es2017"],
        "strict": true,
        "noEmitOnError": true,
        "sourceMap": true,
        "rootDir": "src",
        "incremental": true,
        "outDir": "out"
    },
    "include": [
        "src/**/*"
    ]
}

Expected behavior:

After compilation tsbuildinfo file will be placed in out directory, i.e. ./out/tsconfig.tsbuildinfo.

Actual behavior:

tsbuildinfo file is placed in project root directory, i.e. ./tsconfig.tsbuildinfo.

Playground Link:

Related Issues:
#29161
#30457

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions