pnpm deploy
從工作區部署套件。 During deployment, the files of the deployed package are copied to the target directory. All dependencies of the deployed package, including dependencies from the workspace, are installed inside an isolated node_modules
directory at the target directory. The target directory will contain a portable package that can be copied to a server and executed without additional steps.
注意事項
By default, the deploy command only works with workspaces that have the inject-workspace-packages
setting set to true
. If you want to use deploy without "injected dependencies", use the --legacy
flag or set force-legacy-deploy
to true
.
使用方式:
pnpm --filter=<deployed project name> deploy <target directory>
如果您在部署前已建置專案,請一併使用 --prod
選項來略過 devDependencies
的安裝。
pnpm --filter=<deployed project name> --prod deploy <target directory>