pnpm prune
删除不必要的包。
¥Removes unnecessary packages.
选项
¥Options
--prod
删除 devDependencies 中指定的软件包。
¥Remove the packages specified in devDependencies.
--no-optional
删除 optionalDependencies 中指定的软件包。
¥Remove the packages specified in optionalDependencies.
警告
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.