zirkelc
TypeScript Alias Imports don't get resolved ont the Client
Yes, but that's is unavoidable when using Typescript path aliases. There are two new alternatives:
1. Node.js sub-path imports in the client
2. exporting the trpc outer types from the server and installing the server package as dependency into the client package
12 replies
TypeScript Alias Imports don't get resolved ont the Client
@Shooe#6468406 I used the first option with global paths, just because I have a big monorepo and it was easier to make this change. I think the second option is better if you have multiple packages, but I have not enough experience with project references and there might be some doenside that I'm not aware of.
12 replies
TypeScript Alias Imports don't get resolved ont the Client
Yes, there are two options from my point of view:
1. create a shared global tsconfig.json in your project root that defines the path aliases. Then your server and client have their package-level tsconfig.json inherit from the shared tsconfig.json. All path alaises are defined in the shared tsconfig.json, the package-level tsconfig.json have no alaiases on their own.
2. use typescript projects refrences like here: https://github.com/zirkelc/trpc-monorepo-with-project-references
12 replies