Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ChristianUlbrich opened this issue Oct 8, 2018 · 1 comment

Comments

@ChristianUlbrich
Copy link

[...]

TypeScript's path mapping is the best solution.

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

  • components/services/* having modules like @scope/service1
  • shared/runtime/*... having modules like `@scope/runtime1
  • models/* ... having modules like @scope/model1
    You would need to add them (path mappings) explicitly, because a generic match like the one you propose only works, if all modules are having the same folder depth/layout.

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
Copy link

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?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants