Skip to content

rootDirs / outDir options behaviour change depending on filesΒ #62001

Closed
@homersimpsons

Description

@homersimpsons

πŸ”Ž Search Terms

"rootDirs", "outDir"

πŸ•— Version & Regression Information

  • This fails with typescript@5.8.3

⏯ Playground Link

No response

πŸ’» Code

// src/index.ts
function foo() { return 'bar'; }
// test/index.ts
function foo() { return 'bar'; }
// tsconfig.json
{"compilerOptions": {"outDir": "./dist", "rootDirs": ["./src", "./test"]}}

πŸ™ Actual behavior

Running tsc with both src/index.ts and test/index.ts outputs 2 files: dist/src/index.js and dist/test/index.js.

BUT running the same command without test/index.ts outputs 1 file: dist/index.js, here the src directory is missing.

πŸ™‚ Expected behavior

running the same command without test/index.ts should output 1 file: dist/src/index.js, (with the srcdirectory).

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions