Skip to content

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

@ChristianUlbrich

Description

@ChristianUlbrich

[...]

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions