Skip to content

tsc --build with rootDir and outDir is compiling files within a project in alphabetical order, breaking imports #25864

@rosslovas

Description

@rosslovas

TypeScript Version: 3.1.0-dev.20180721

Search Terms: tsc build project reference rootDir outDir

Code

Brief summary: When rootDir and outDir are involved as well as a project reference, source files within an individual project that has a dependency project would be compiled in alphabetical order. The consequence is that an A.ts that imports from B.ts will fail with Output file '.../B.d.ts' has not been built from source file '.../B.ts' but if I rename A.ts to C.ts everything works, as does removing the project reference or not using root/outDir.

The setup is hard to fully convey through text so here's a zip: repro.zip. npm install then npm run build to trigger the issue.

Expected behavior: Compiles both main and other projects successfully regardless of the names of the source files.

Actual behavior:

error TS6305: Output file '.../B.d.ts' has not been built from source file '.../B.ts'.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions