Pnpm: Don't run the pre/post scripts

Created on 23 Sep 2020  路  3Comments  路  Source: pnpm/pnpm

When running pnpm run foo, don't run the prefoo script and the postfoo script.

Yarn 2 already deprecated the pre/post scripts:

In particular, we intentionally don't support arbitrary pre and post hooks for user-defined scripts (such as prestart). This behavior, inherited from npm, caused scripts to be implicit rather than explicit, obfuscating the execution flow. It also led to surprising executions with yarn serve also running yarn preserve.

https://yarnpkg.com/advanced/lifecycle-scripts

breaking change

All 3 comments

Does this affect postinstall as well? Because many packages use postinstall to perform operations that are not covered by the package manager (such as copying fonts, building, etc). In my opinion, not running that is not a good approach!

no, the standard lifecycle scripts like postinstall or prepublishOnly are not affected.

but prepostinstall will not be executed. And postpostinstall as well.

Was this page helpful?
0 / 5 - 0 ratings