yarnhook
keeps your node_modules
up-to-date when your yarn.lock
or package-lock.json
changes
due to git operations like checkout
, merge
, rebase
, pull
etc.
This package should be used with husky.
yarn add --dev yarnhook husky
# or
npm install --save-dev yarnhook husky
You should let yarnhook
handle git hooks that change the dependencies. Example package.json
is
as follows:
{
"scripts": {
"postmerge": "yarnhook",
"postcheckout": "yarnhook",
"postrewrite": "yarnhook"
}
}
Prepend YARNHOOK_BYPASS=true
to your git command if you don't want to run yarn install
or
npm install
as a result, YARNHOOK_DEBUG=true
to print debug information.
An example:
YARNHOOK_BYPASS=true git checkout feature-branch
Project logo: @anilkilic
Font: PT Sans