Skip to content

Commit

Permalink
Move build to prepack
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Methuselah96 committed Feb 22, 2023
1 parent c9204ee commit a80c4d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a80c4d0

Please sign in to comment.