#2967·berry

[Feature] reconsider prepare lifecycle script?

Author: typicodeCreated Jun 2, 2021Updated Sep 2, 2026
Labelsenhancement
  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

As a developer, I may need to run some development only postinstall script.

Describe the solution you'd like

Enable prepare script.

Describe the drawbacks of your solution

I'm aware Yarn 2 tries to simplify and limit the number of lifecycle hooks. I think it's good a thing.

However, except with some tricks and AFAIK there's no way to have a development only postinstall script with Yarn 2.

Describe alternatives you've considered

Since only postinstall can be used to run commands after yarn, I've created pinst as a way to disable it when a package is published (simulating a dev-only postinstall script).

There's an example here: https://typicode.github.io/husky/#/?id=yarn-2