• Discover
  • Collections
  • Board
  • Create
  • Profile
  • Settings
Paths

Lesson 3.3: Advanced Filtering and Task Execution

Lesson 3.3: Advanced Filtering and Task Execution

1 min read

Turborepo provides powerful filtering capabilities that allow you to execute tasks only on specific packages or subsets of packages within your monorepo.

The turbo run --filter command is incredibly versatile:

  • --filter=<package-name>: Runs tasks only for the specified package.
  • --filter='<package-name>...': Runs tasks for the specified package and all packages that depend on it.
  • --filter='...<package-name>': Runs tasks for the specified package and all packages it depends on.
  • --filter='[HEAD^1]': Runs tasks only for packages that have changed since the last commit.
  • --filter='[<commit-ish>...]': Runs tasks for packages changed between the current HEAD and a specific commit/branch.

These filtering options are invaluable for optimizing CI/CD workflows, enabling you to run tests or builds only on the parts of your monorepo that were actually affected by a change. This targeted execution reduces CI times and resource consumption. Combining advanced turbo.json configurations with intelligent filtering allows for highly efficient and scalable monorepo management, ensuring developers get fast feedback and builds are always optimized.

End of lesson
👏Well done!
Previous Lesson
Lesson 3.2: Leveraging Remote Caching with Turborepo Cloud
Next Lesson
Quiz: Module 3: Advanced Turborepo Features and Optimizations

Course Content

0% Complete0/16 Lessons

Lesson 1.1: Polyrepo vs. Monorepo - A Fundamental Choice

Lesson 1.2: The Advantages of a Monorepo

Lesson 1.3: The Challenges of a Monorepo

Quiz

Lesson 3.1: Configuring the `turbo.json` Pipeline in Detail

Lesson 3.2: Leveraging Remote Caching with Turborepo Cloud

Lesson 3.3: Advanced Filtering and Task Execution

Quiz

Course Content

0% Complete0/16 Lessons

Lesson 1.1: Polyrepo vs. Monorepo - A Fundamental Choice

Lesson 1.2: The Advantages of a Monorepo

Lesson 1.3: The Challenges of a Monorepo

Quiz

Lesson 3.1: Configuring the `turbo.json` Pipeline in Detail

Lesson 3.2: Leveraging Remote Caching with Turborepo Cloud

Lesson 3.3: Advanced Filtering and Task Execution

Quiz