vx prune copies one app and the workspace packages it needs, with the
lockfile cut to match. It follows every dependency, dev ones included,
because the build needs them. The image that only runs the built app does
not.
$ vx prune app --docker --production vx prune: 2 projects → out (json/ + full/) (production), bun.lock pruned app (packages/app) lib (packages/lib) test-utils stays behind. The copied package.json files and the lockfile
no longer name it, so the copy installs with a frozen lockfile under bun,
pnpm, npm and Yarn:
FROM oven/bun AS run COPY out/json/ . RUN bun install --frozen-lockfile --production COPY out/full/ . CMD ["bun", "packages/app/dist/index.js"] A package that another field also names (dependencies, an optional or a
peer dependency) is installed in production and stays. Third-party dev
dependencies stay in the lockfile; the install's own --production flag
skips them.
Originally published on the vx blog. vx is an MIT task runner and build cache for JS monorepos: vznjs.github.io/vx · GitHub.
Written with AI assistance.

![Why Object.keys(user) Returns string[], Not (keyof User)[]: TypeScript Means It](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2q4w48b9bzs43tynyhsf.png)