Skip to content

Commit a635568

Browse files
committed
docs: add more information to prepare and prepack scripts
1 parent a5a2844 commit a635568

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/pages/build.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,14 @@ yarn add --dev react-native-builder-bob
6161

6262
Note that there is a difference between `prepare` and `prepack` scripts:
6363

64-
- `prepare` is run when the package is published, as well as when its is installed from a git URL. It may also run when dependencies are installed based on the package manager.
65-
- `prepack` only runs when the package is packed for publishing.
66-
67-
If you are not sure which one to use, we recommend going with `prepare`.
64+
- `prepare` is run when:
65+
- The package is published with Yarn 1 (`yarn publish`), npm (`npm publish`) or pnpm (`pnpm publish`)
66+
- The package is installed from a GIT URL with Yarn 1 (`yarn add <git-url>`), npm (`npm install <git-url>`) or pnpm (`pnpm add <git-url>`)
67+
- `prepack` is run when:
68+
- The package is published with any package manager (`yarn publish`, `npm publish`, `pnpm publish`)
69+
- The package is installed from a GIT URL with Yarn 4 (`yarn add package-name@<git-url>`)
70+
71+
If you are not sure which one to use, we recommend going with `prepare` as it works during both publishing and installing from GIT with more package managers.
6872

6973
1. Configure the appropriate entry points:
7074

0 commit comments

Comments
 (0)