4

I am migrating from yarn version 1.22 to yarn v3.2.3. I have a prepare script that was running automatically after install.

My prepare script generates some files (FIY Nuxt 3 generated files).

It does not run anymore on yarn 3, and how can I get the same effect? I don't find it on https://yarnpkg.com/advanced/lifecycle-scripts. Maybe I am misreading.

Lyokolux
  • 1,227
  • 2
  • 10
  • 34

1 Answers1

5

I have finally found a solution:

  1. Install the Yarn plugin after install: yarn plugin import https://raw.githubusercontent.com/mhassan1/yarn-plugin-after-install/v0.3.1/bundles/@yarnpkg/plugin-after-install.js.
  • See the command in the README to get the latest version.
  1. In a .yarnrc.yml at the root of your project, add your command: afterInstall: <your-command>
Lyokolux
  • 1,227
  • 2
  • 10
  • 34