avvo
avvo5d ago

tRPC Monorepo w/ Package Path Aliases

Does anyone have a working example of tRPC's API router definitions in a package in a monorepo with path aliases working in that sub package? Something like create-t3-turbo but with path aliases in that API sub package. I see Julius has setup a great monorepo example, however I see in all the packages he is only using relative imports. Is this possible?
5 Replies
avvo
avvoOP5d ago
@julius Sorry for the tag, but might need some expert knowledge here.
Nick
Nick4d ago
Path aliases are a build system question, tRPC doesn’t care so long as your typescript and bundler setup is correct I use absolute imports all the time at work
avvo
avvoOP4d ago
of course, however i'm just wondering if you've worked in a repo with path aliases in subpackages in any build system
Nick
Nick4d ago
Takes a bit of configuration typically but yeah you can do it
avvo
avvoOP4d ago
specifically someApp <- trpc with trpc procedure definitions being imported by path alias

Did you find this page helpful?