Skip to content

Empty object required for path aliasing to work #270

Open
@mrmckeb

Description

@mrmckeb

I've found a fix for the problem, and a potential improvement in either the code or the docs (or both!).

This line sets up the alias imports:

It needs the presence of baseUrl and paths in your tsconfig to create an alias importer. baseUrl gets a default value, so this check does nothing, but paths need to exist (even if an empty object), to create the path matcher.

The easy fix is just to add the following to your tsconfig:

 "compilerOptions": {
   "paths": {}
 }

This then allows the alias importer to resolve relative to your tsconfig, as well as relative to the file it is resolving.

Originally posted by @RMHonor in #267 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions