pnpm prune
删除不必要的包。
🌐 Removes unnecessary packages.
选项
🌐 Options
--prod
删除 devDependencies 中指定的包。
🌐 Remove the packages specified in devDependencies.
--no-optional
删除 optionalDependencies 中指定的包。
🌐 Remove the packages specified in optionalDependencies.
warning
prune 命令目前不支持在 monorepo 上递归执行。要在 monorepo 中只安装生产依赖,可以删除 node_modules 文件夹,然后使用 pnpm install --prod 重新安装。
🌐 The prune command does not support recursive execution on a monorepo currently. To only install production-dependencies in a monorepo node_modules folders can be deleted and then re-installed with pnpm install --prod.