vp pm prune
Remove unnecessary installed packages.
bash
vp pm prune
vp pm prune --prodOptions
| Option | Description | Notes |
|---|---|---|
--prod | Remove devDependencies. | |
--no-optional | Remove optional dependencies. |
Compatibility
- npm:
npm prune. - pnpm:
pnpm prune. - Yarn Classic: No command. Warns and exits successfully without performing the operation.
- Yarn Modern: No command. Warns and exits successfully without performing the operation.
- Bun: 1.4 or later:
bun prune. Earlier versions warn and skip.
| Option | npm | pnpm | Yarn Classic | Yarn Modern | Bun | Notes |
|---|---|---|---|---|---|---|
--prod | Yes | Yes | No | No | 1.4 or later | |
--no-optional | Yes | Yes | No | No | 1.4 or later |
npm translates selection flags to --omit=dev and --omit=optional. Bun translates --prod to --production. Yarn and older Bun remove extraneous packages during installation instead of providing a native prune command.
Native Options
For native options, see npm prune, pnpm prune, and Bun prune. To pass these options through Vite+, see Native Arguments.