You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I have found it is possible to sit a package.json file in a lib/blah directory - Nx ignores it and continues working as before, and using that package file you can do all the normal things that you would do to make a valid NPM TypeScript package.
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?
The text was updated successfully, but these errors were encountered: