From a80c4d0cc1b27338bff759995e55133cbe1b486d Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Wed, 22 Feb 2023 08:43:39 -0500 Subject: [PATCH] Move build to prepack From [Yarn docs about lifecycle scripts](https://yarnpkg.com/advanced/lifecycle-scripts): > Note about yarn pack: Although rarely called directly, yarn pack is a crucial part of Yarn. Each time Yarn has to fetch a dependency from a "raw" source (such as a Git repository), it will automatically run yarn install and yarn pack on it to know which are the files to use. I have found this change to be helpful when trying to install Redux using [the Git protocol](https://yarnpkg.com/features/protocols#git) in order to test out changes on a specific branch. `prepack` is run as part of a [`npm/yarn publish`](https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-publish) so this change should hopefully not change anything about publishing. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b316c878ff..553880e495 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,8 @@ "test:watch": "vitest", "test:cov": "vitest --coverage", "build": "rollup -c", - "prepublishOnly": "yarn clean && yarn check-types && yarn format:check && yarn lint && yarn test && yarn build", + "prepack": "yarn build", + "prepublishOnly": "yarn clean && yarn check-types && yarn format:check && yarn lint && yarn test", "examples:lint": "eslint --ext js,ts examples", "examples:test": "cross-env CI=true babel-node examples/testAll.js", "tsc": "tsc"