Only Deploy to Vercel What has Been Affected Using Nx

Share this video with your friends

Send Tweet
Published 3 months ago
Updated 2 months ago

In an Nx monorepo, you typically have multiple applications and lots of libraries. When we configure Vercel for deployment, we set one Vercel deployment for each app in our monorepo. However, we would want to make sure that not all the apps are being deployed all the time, but only if the app was really affected by the change. Nx affected commands can help here.

In this lesson we're going to create a simple script, that leverages the Nx affected commands to determine whether we should cancel or continue a given Vercel deployment.

Prefer to read along as well? Here's the accompanying article.