bun installer should support a `--prune` option
What is the problem this feature would solve?
When building for deployment (i.e., there is a build step defined in package.json), a common paradigm is to install all dependencies (including devDependencies), run the build step, then prune the devDependencies. npm, yarn, and pnpm all support this feature.
What is the feature you are proposing to solve the problem?
A prune subcommand or option, much like npm, yarn, and pnpm already support.
What alternatives have you considered?
Here's what I'm currently emitting in Dockerfiles when Bun applications are launched at fly.io:
rm -rf node_modules && bun install --ci
See also: packagerPrune and Fly.io ❤️ Bun.
+1
this option would help a lot in Dockerfiles
an abbreviated example
FROM oven/bun:slim AS base
FROM base as dependencies
COPY bun.lockb package.json ./
RUN bun install
FROM dependencies AS production
RUN bun prune --production
FROM base
COPY --from=production node_modules/ ./node_modules/
bun prune --production
This gives the following result:
Uh-oh. bun prune is a subcommand reserved for future use by Bun.
If you were trying to run a package.json script called prune, use bun run prune.
bun -v
1.1.33
+1
+1 I would love to be able to prune extraneous packages, especially in a workspace 👍
It would be super useful
Bump