Skip to content

postinstall-postinstall 介绍

为什么使用 postinstall-postinstall 的链接:

https://www.npmjs.com/package/patch-package#why-use-postinstall-postinstall-with-yarn

内容如下:

Most times when you do a yarnyarn addyarn remove, or yarn install (which is the same as just yarn) Yarn will completely replace the contents of your node_modules with freshly unpackaged modules. patch-package uses the postinstall hook to modify these fresh modules, so that they behave well according to your will.

Yarn only runs the postinstall hook after yarn and yarn add, but not after yarn remove. The postinstall-postinstall package is used to make sure your postinstall hook gets executed even after a yarn remove.

搞不懂,npm 官网介绍说要用,那就用呗。没有那么多为什么。我也不想搞懂为什么了。

这玩意一般配合 patch-package 使用,用来修改第三方包。

Released under the MIT License.