Allow restricting bun install
to specific packages in a workspace
#15948
Labels
enhancement
New feature or request
bun install
to specific packages in a workspace
#15948
What is the problem this feature would solve?
When we have a workspace project with many different packages,
bun
requires all packages to be present when runningbun install
even if we just want to install the dependencies for a single package.This is relevant for Docker where if we have many packages, we want to copy just the required packages to keep the Docker image size small.
For example, in a monorepo with multiple services, each service might only depend on a subset of shared packages:
packages/api
depends onpackages/shared
packages/web
depends onpackages/ui
andpackages/shared
packages/mobile
depends onpackages/ui
andpackages/shared
When building a Docker image for just the API service, we currently have to copy ALL packages (
web
,mobile
,ui
, etc.) even though we only needapi
andshared
. This is because the lockfile contains references to all workspace packages.What is the feature you are proposing to solve the problem?
Add ability to scope installation to specific packages, similar to pnpm's
--filter
flag:What alternatives have you considered?
package.json
in the Dockerfile (loses the lockfile benefits and is just generally janky)The text was updated successfully, but these errors were encountered: