2

I am planning to split some of the code in my project to NPM/Yarn workspaces. But some of the workspaces will be used only during development. Just to be clear, I am not referring to devDependencies for the workspace. The workspace itself is a devDependency of the root project.

How can I ignore these workspaces from a production installation?

yarn install --production --frozen-lockfile

installs the production dependencies for the dev only workspaces.

If I run the above command after removing the dev only workspace directories from the production server, the installation fails since the lockfile will be modified.

How can I maintain a development only dependency as workspace, and yet prevent its installation on production build. I don't particularly prefer Yarn, NPM or PNPM. I would appreciate suggestions that will work on any of them.

RobC
  • 22,977
  • 20
  • 73
  • 80
Joyce Babu
  • 19,602
  • 13
  • 62
  • 97

0 Answers0