From 50a7a1e8f78ebe84c7be1eff7e1162e19526e2e8 Mon Sep 17 00:00:00 2001 From: Ian White Date: Wed, 26 May 2021 09:13:05 -0500 Subject: [PATCH] docs: fix typo in rulebook (#2932) Fix typo. --- packages/gatsby/content/advanced/rulebook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby/content/advanced/rulebook.md b/packages/gatsby/content/advanced/rulebook.md index c814342e5847..e0d1ded4f3f3 100644 --- a/packages/gatsby/content/advanced/rulebook.md +++ b/packages/gatsby/content/advanced/rulebook.md @@ -123,6 +123,6 @@ If you absolutely need to write into your package's source folder (but really, w ## Packages should use the `prepack` script to generate dist files before publishing -**Why?** The original npm supported [many different scripts](https://docs.npmjs.com/misc/scripts). So much, in fact, that it became very difficult to know which script one would want to use in which context. In particular, the very subtle differences between the `prepack`, `prepare`, `prepublish`, and `prepublish-only` scripts led many to use the wrong script in the wrong context. For this reason, Yarn 2 deprecated most of the scripts and consolidated then around a restricted set of portable scripts. +**Why?** The original npm supported [many different scripts](https://docs.npmjs.com/misc/scripts). So much, in fact, that it became very difficult to know which script one would want to use in which context. In particular, the very subtle differences between the `prepack`, `prepare`, `prepublish`, and `prepublish-only` scripts led many to use the wrong script in the wrong context. For this reason, Yarn 2 deprecated most of the scripts and consolidated them around a restricted set of portable scripts. **Solution:** Always use the `prepack` script if you wish to generate dist artifacts before publishing your package. It will get called before calling `yarn pack` (which itself is called before calling `yarn npm publish`), when cloning your git repository as a git dependency, and any time you will run `yarn prepack`. As for `prepublish`, never use it with side effects - its only use should be to run tests before the publish step.