Skip to content

How to get tsconfig path aliases to work? #43

Answered by fwouts
keithkraker asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @keithkraker, sorry to hear you've been having trouble! React Preview normally picks up aliases from tsconfig.json, but there is currently no way to tell it to use a different file such as tsconfig.base.json.

However, you can provide aliases in the alias field of reactpreview.config.js. For example:

{
  foo: "/src/foo"
} 

If you need a bit more help, feel free to copy paste your paths from tsconfig.base.json here.

Also, more extensive docs are coming on reactpreview.com in the next two weeks 🙂

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by fwouts
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants