How to ignore changed files when publishing with Lerna

February 08, 2021

lerna

Before tagging a new version, lerna scans your codebase for changed files. If it finds a changed file, it’ll recommend a new version. This is really useful most of the time, but you only want to bump to a new version when some library functionality changes. You certainly don’t want to introduce a new version just because you changed the README.md file.

There are two ways that you can tell lerna to ignore specific changed files.

The —ignore-changes flag

You can use the --ignore-changes flag to prevent lerna from publishing new versions when it finds changes in specific file types.

lerna version --ignore-changes '**/*.md'

In the lerna.json file

If you’d prefer, you can add an ignore key in the lerna.json file.

// lerna.json

"commands": {
  "version": {
    "ignore": ["**/*.md"]
  }
}

Hungry for more?


If you liked this post, please consider sharing it!

Want frequent design systems tips, articles, and jobs sent right to your inbox?

Sign up for the Design Systems Newsletter today!

If you're unable to sign up, please turn off your ad blocker and try again.

© Mae Capozzi's Website 2022