Quramy / lerna-yarn-workspaces-example

How to build TypeScript mono-repo project with yarn and lerna
MIT License
898 stars 94 forks source link

Is path mapping for "Resolve Dependencies as TypeScript Modules" really the best solution? #15

Open ChristianUlbrich opened 6 years ago

ChristianUlbrich commented 6 years ago

[...]

TypeScript's path mapping is the best solution.

How so? If you have a more elaborated (TM) file layout such as:

This hinders scalability and it in general a path mapping does not allow to refactor the file layout, without modifying the path mapping.

I think, this is the wrong approach; lerna bootstrap is explicitly abstracting the file layout of your modules away by sym-linking them correctly. Thus enabling "preserveSymlinks": true in each individual module's tsconfig.json is to me the more flexible (and hence better) solution.

However I like your point of view, why you settled with the path mapping option. Care to elaborate?

johannesschobel commented 5 years ago

hey @ChristianUlbrich ,

i think, this may be a relic from the typescript 2.x times. TypeScript 3.x introduced the project references, which may be more appropriate in such scenarios..

how did you manage to solve your issue?!