Getting Sub-dependencies in a pnpm Deployment Without Bundling

19 views Asked by At

We're using pnpm now in our monorepo. Everything is working great when running locally. Everything is working great when deploying for packages that are bundled.

For the couple Node Express applications that we do not bundle, our deployment process ZIPs those package folders which breaks the symbolic link to the pnpm store in the root workspace. Unfortunately, this causes the dependencies of these applications to lose access to all of their subdependencies.

What I would like is for the node_modules in each of the applications that I specify to have a flat node_modules structure, without having to hoist every package to the root workspace's node_modules, but I cannot for the life of me figure out how to do this.

Is it possible to tell pnpm to install the node_modules for a particular package in a flat structure, including all subdependencies?

I have tried almost every configuration option from the pnpm documentation, but none seems to give the desired result. I am explicitly not looking to hoist all of the packages to the root workspace's node_modules, which is easily accomplished.

0

There are 0 answers