Skip to main content
Version: 9.x

pnpm patch-commit <path>

从目录中生成补丁并保存它(受到 Yarn 中类似命令的启发)。

¥Generate a patch out of a directory and save it (inspired by a similar command in Yarn).

该命令将比较 path 与要打补丁的包的更改,生成补丁文件,将补丁文件保存到 patchesDir(可以通过 --patches-dir 选项自定义),并在顶层添加到 patchesDependencies 的条目 清单文件。

¥This command will compare the changes from path to the package it was supposed to patch, generate a patch file, save the a patch file to patchesDir (which can be customized by the --patches-dir option), and add an entry to patchesDependencies in the top level manifest file.

用法:

¥Usage:

pnpm patch-commit <path>
  • path 是补丁目标包的修改副本的路径,它通常是 pnpm patch 生成的临时目录。

    ¥path is the path to a modified copy of the patch target package, it is usually a temporary directory generated by pnpm patch.

选项

¥Options

---patches-dir <patchesDir>

生成的补丁文件将保存到该目录下。默认情况下,补丁保存在项目根目录的 patches 目录下。

¥The generated patch file will be saved to this directory. By default, patches are saved to the patches directory in the root of the project.