pnpm patch <pkg>
為修補程序準備套件 (從 Yarn 中類似的命令激發)。
這個命令將會造成套件在設計為可編輯的臨時目錄中被壓縮。
Once you're done with your changes, run pnpm patch-commit <path>
(with <path>
being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the patchedDependencies
field.
使用方式:
pnpm patch <pkg name>@<version>
注意事項
If you want to change the dependencies of a package, don't use patching to modify the package.json
file of the package. For overriding dependencies, use overrides or a package hook.
Options
--edit-dir <dir>
需要修補的套件會被解壓縮到此資料夾中。
--ignore-existing
進行修補時,忽略現有的修補檔案。