Skip to content

problem using a "lib" also for server consumption (node.js) #231

@maku

Description

@maku

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions