pnpm deploy
从工作区部署包。部署过程中,部署包的文件会被复制到目标目录。已部署包的所有依赖(包括来自工作区的依赖)都安装在目标目录的隔离 node_modules
目录中。目标目录将包含一个可移植包,可以将其复制到服务器并执行,无需其他步骤。
¥Deploy a package from a workspace. 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.
用法:
¥Usage:
pnpm --filter=<deployed project name> deploy <target directory>
如果你在部署之前构建项目,还可以使用 --prod
选项来跳过 devDependencies
安装。
¥In case you build your project before deployment, also use the --prod
option to skip devDependencies
installation.
pnpm --filter=<deployed project name> --prod deploy <target directory>