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

Empty object required for path aliasing to work #270

Open
mrmckeb opened this issue Oct 10, 2024 · 0 comments
Open

Empty object required for path aliasing to work #270

mrmckeb opened this issue Oct 10, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@mrmckeb
Copy link
Owner

mrmckeb commented Oct 10, 2024

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)

@mrmckeb mrmckeb added the bug Something isn't working label Oct 10, 2024
@mrmckeb mrmckeb added this to the v6.0.0 milestone Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant