Jonathan Pritchard
Jonathan Pritchard

Reputation: 333

Typescript changing the output directory structure to include src

The Typescript compiler seems to randomly change the structure of the output directory which throws off linked dependants.

Where it used to be

+- dist
  +- index.d.ts
  +- index.js

It suddenly changed to

+- dist
  +- src
    +- index.d.ts
  +- index.js

(I know the answer I'm just signposting for my forgetful future self - been through this twice already!)

Upvotes: 1

Views: 433

Answers (1)

Jonathan Pritchard
Jonathan Pritchard

Reputation: 333

I'd added a test-utils folder to the project root and it contained modules that were referenced by test modules under src and so tsc changed the directory structure to accomodate.

Check you're not referencing modules at the top level by accident

Upvotes: 1

Related Questions