I have the problem that a lib which contains logic should also be used in a server (node.js based).
In this case I have a basic lib which contains generic logic and a concrete "domain" lib which is based on this basic lib (say salesmodel lib uses model lib)
Now this salesmodel lib should be usable in client AND server. But I have really no idea how to get that working. (up to now this libs were good old dependencies)
Recognized problems: libs are exposed via typescript path. So all imports in "salesmodel lib" are barrel based. e.g.
import {x} from @myproject/salesmodel
Node.js is not able to resolve this. Maybe this can be solved via a helper like https://github.com/dividab/tsconfig-paths
But I have also problems on compiling the server part. How can I structure the app that the server part is included
Is there something like a guide how to tackle this? Has anybody solved this problem?
I have the problem that a lib which contains logic should also be used in a server (node.js based).
In this case I have a basic lib which contains generic logic and a concrete "domain" lib which is based on this basic lib (say salesmodel lib uses model lib)
Now this salesmodel lib should be usable in client AND server. But I have really no idea how to get that working. (up to now this libs were good old dependencies)
Recognized problems: libs are exposed via typescript path. So all imports in "salesmodel lib" are barrel based. e.g.
import {x} from @myproject/salesmodelNode.js is not able to resolve this. Maybe this can be solved via a helper like https://github.com/dividab/tsconfig-paths
But I have also problems on compiling the server part. How can I structure the app that the server part is included
Is there something like a guide how to tackle this? Has anybody solved this problem?