Running Scripts in Changed Packages Based on Git Branch with Yarn Workspaces

less than 1 minute read

Based on Yarn v4.4.0.

This is a method to run scripts only in the packages that have changed, based on the git branch, when your monorepo is configured using Yarn workspaces.

yarn workspaces foreach --since=develop run build # runs the build script, comparing with the develop branch

Do not use --since develop this way!

20240911

Tags:

Categories:

Updated:

Leave a comment