I have a folder of typescript code that I want to share between two TS projects in a repo. It's various helper classes and DB models. They don't have unifying logic of their own, so it doesn't make sense to make them into a library.
If I include the common folder in the paths
config (link), or the rootDirs
(link), the root of the output folder changes to the most common path (link). Instead, I want to keep each project folder as output root, and instead build the common folder into that root of each project.
I imagine that if I alias the common folder JS destination using paths
, I can use it in my imports.
How do I achieve this? (similar question).
input:
/project1/**/*.ts
/project2/**/*.ts
/common/**/*.ts
output project1:
/project1/**/*.js
/project1/common/**/*.js
output project2:
/project2/**/*.js
/project2/common/**/*.js