How to build a standalone package that depends on other yarn workspace packages

55 views Asked by At

I'm using Yarn workspaces to link my packages in a TypeScript monorepo. Everything works fine, every package has its own tsconfig and I'm using references and composite in those tsconfigs.

I can import things and I can do tsc --build and everything that needs to be built gets built. The problem I'm having is packaging this build into one, standalone, program. I don't want to deploy the whole monorepo, I just want to deploy one package that depends on the other and I cant seem to find a way to do this.

I know I can bundle things but I don't want to bundle external dependencies. I just want to npm i those dependencies for every package that is needed for the main package. I've managed to do it with scripts that manipulate files and package.json contents but I'm looking for a non-convoluted way of doing it.

0

There are 0 answers