惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
宝玉的分享
宝玉的分享
博客园_首页
V
V2EX
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
Recorded Future
Recorded Future
J
Java Code Geeks
Martin Fowler
Martin Fowler
小众软件
小众软件
人人都是产品经理
人人都是产品经理
Help Net Security
Help Net Security
The Register - Security
The Register - Security
B
Blog RSS Feed
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
C
CERT Recently Published Vulnerability Notes
P
Privacy International News Feed
D
DataBreaches.Net
博客园 - 【当耐特】
K
Kaspersky official blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
L
LINUX DO - 热门话题
Jina AI
Jina AI
G
GRAHAM CLULEY
H
Help Net Security
D
Docker
Microsoft Security Blog
Microsoft Security Blog
S
Securelist
O
OpenAI News
U
Unit 42
V2EX - 技术
V2EX - 技术
腾讯CDC
罗磊的独立博客

Nx Blog

Sharing Tailwind CSS Styles Across Apps in a Monorepo | Nx Blog How SiriusXM Stays Competitive by Iterating and Getting to Market Fast | Nx Blog Agentic Experience Is the New Developer Experience | Nx Blog Nx Joins the Linux Foundation and the Agentic AI Foundation | Nx Blog A Monorepo Is NOT a Monolith | Nx Blog Why we deleted (most of) our MCP tools | Nx Blog Teach Your AI Agent How to Work in a Monorepo | Nx Blog How Broadcom stays efficient and nimble with monorepos | Nx Blog Why Monorepos are King in the Age of AI | Nx Blog Nx 2026 Roadmap: Expanding Agent Autonomy, Improving Performance, Better Polyglot and More | Nx Blog End to End Autonomous AI Agent Workflows with Nx | Nx Blog Autonomous Agents at Scale | Nx Blog Scaling 700+ Projects: How Nx Became a 'No-Brainer' for Caseware | Nx Blog Configure Tailwind v4 with Angular in an Nx Monorepo | Nx Blog The Missing Multiplier for AI Agent Productivity | Nx Blog A Year of Nx Webinars | Nx Blog Wrapping Up 2025 | Nx Blog Nx 22.3 Release: Angular 21 Support, tsgo Compiler, and Prettier v3 | Nx Blog Nx Cloud Release: Agent Resource Usage | Nx Blog Nx Platform Outperforms DIY Cache by 5x | Nx Blog An Nx Carol: Past, Present, and Future of Your Monorepo | Nx Blog Nx 22.1 Release: Terminal UI on Windows, Storybook 10, Vitest 4, and more! | Nx Blog The Compounding Effect: How Nx Features Multiply Performance Gains | Nx Blog 10 Monorepo Myths Debunked: Separating Fact from Fiction | Nx Blog Nx Cloud Release: Enterprise Task Analytics | Nx Blog Watch and Rebuild Storybook Dependencies with Nx | Nx Blog Book - React for Enterprise: Timeless Architecture for Enterprise Apps | Nx Blog Beyond Remote Cache: Unlock 70% More CI Performance | Nx Blog Nx 22 Release: Expanding the build platform | Nx Blog What's the Point of Generating All This Code If You Can't Merge It? | Nx Blog What's New in Nx Self-Healing CI | Nx Blog Nx Highlights: Smarter AI integration, all-new graph UI, and big new versions of your favorite tools | Nx Blog Making the Case for Smarter Monorepos, and How to Not Get Fooled by Myths | Nx Blog Integrating Biome in 20 Minutes | Nx Blog S1ngularity - What Happened, How We Responded, What We Learned | Nx Blog Stop Babysitting Your PRs: Self-Healing CI Cuts Time to Green by 50% | Nx Blog UKG Unifies Their Codebase and Eliminates CI Overhead to Focus on Customer Value | Nx Blog How Git Worktrees Changed My AI Agent Workflow | Nx Blog Nx Cloud Workspace Graph: See Your Organization's Code Structure Like Never Before | Nx Blog Seamless Java Deployment in Nx Using Docker | Nx Blog Getting Mobile Into Your Monorepo: Android + Nx | Nx Blog Polyglot Projects Made Easy: Integrating Spring Boot into an Nx Workspace | Nx Blog The Journey of the Nx Plugin for Gradle: From Prototype to Production | Nx Blog Combining Predictability and Intelligence With Nx Generators and AI | Nx Blog A New UI For The Humble Terminal | Nx Blog New and Improved Module Federation Experience with Nx | Nx Blog A New UI for Nx Migration | Nx Blog Custom Task Runners and Self-Hosted Caching Changes | Nx Blog Enterprise Angular Monorepo Patterns | Nx Blog Using Rspack with Angular | Nx Blog Angular Architecture Guide To Building Maintainable Applications at Scale | Nx Blog Modern Angular Testing with Nx | Nx Blog Nx Update: 20.5 | Nx Blog Are Monorepos the Answer to Better AI-Assisted Development? | Nx Blog Making Cursor Smarter with an MCP Server For Nx Monorepos | Nx Blog React Development for 2025 | Nx Blog Using Apollo GraphQL in an Nx Workspace | Nx Blog Angular State Management for 2025 | Nx Blog Tailoring Nx for Your Organization | Nx Blog Nx Cloud Pipelines Come To Nx Console | Nx Blog Define the relationship with monorepos | Nx Blog See your affected project graph in Nx Cloud | Nx Blog Handling CORS In Your Workspace | Nx Blog Improve your architecture and CI pipeline times with Nx projects | Nx Blog Announcing Nx 20 | Nx Blog Introducing Nx Powerpack | Nx Blog Nx 19.5 is here! Stackblitz, Bun, Incremental Builds for Vite, Gradle Test Atomizer | Nx Blog Introducing Explain with AI | Nx Blog Nx Enterprise Podcast Episode 2: Tine Kondo | Nx Blog Monorepos and CI can be a Mess - Here's How Nx and Nx Cloud Fixed It | Nx Blog Nx Enterprise Podcast Episode 1: Hicham El Hammouchi | Nx Blog Nx 19.0 Release!! | Nx Blog Manage Your Gradle Project using Nx | Nx Blog Making the Argument for Monorepos | Nx Blog Reliable CI. A new execution model fixing both flakiness and slowness | Nx Blog Monorepos - Why Speed Matters | Nx Blog Nx Agents Walkthrough: Effortlessly Fast CI Built for Monorepos | Nx Blog Launch Nx Week Recap | Nx Blog Versioning and Releasing Packages in a Monorepo | Nx Blog Fast, Effortless CI | Nx Blog Introducing @nx/nuxt Enhanced Nuxt.js Support in Nx | Nx Blog What if Nx Plugins Were More Like VSCode Extensions | Nx Blog Monorepos: the Benefits, Challenges, and Importance of Tooling Support | Nx Blog Nx — Highlights of 2023 | Nx Blog Nx 17.2 Update | Nx Blog Unit Testing Expo Apps With Jest | Nx Blog Nx Docs AI Assistant | Nx Blog State Management Nx React Native/Expo Apps with TanStack Query and Redux | Nx Blog Nx 17 has Landed | Nx Blog Nx Conf 2023 — Recap | Nx Blog Nx Raises $16M Series A | Nx Blog Introducing Playwright Support for Nx | Nx Blog Nx 16.8 Release!!! | Nx Blog Step-by-Step Guide to Creating an Expo Monorepo with Nx | Nx Blog Qwikify your Development with Nx | Nx Blog Create Your Own create-react-app CLI | Nx Blog Storybook Interaction Tests in Nx | Nx Blog Evergreen Tooling — More than Just CodeMods | Nx Blog Nx 16.5 Release!!! | Nx Blog A Practical Guide on Effective AI Use - AI as Your Peer Programmer | Nx Blog
Continuous tasks are a huge DX improvement | Nx Blog
Philip Fulcher · 2025-05-10 · via Nx Blog

Nx 21 Launch Week

Continuous tasks are one of the most exciting features we've launched that radically improve the developer experience (DX) of your monorepo.

What are continuous tasks?

Many of the tasks in your workspace are finite: they run, produce an output, and shut down on their own. Continuous tasks are long-lived tasks: they run until interrupted by an outside input. These are tasks like serving your application or running tests in watch mode. While Nx has always supported running these tasks, you couldn't configure other tasks to depend on them.

For example, you could serve your backend and frontend separately, but you couldn't easily configure your backend to be served whenever your frontend is served. There are always options like opening two separate terminals to run the tasks or setting up a specific script or task for running these in parallel. But the DX has always been lacking.

Now, tasks can be marked as continuous, and other tasks can depend on them. Nx will no longer wait for these tasks to shut down before invoking the tasks that depend on them. These continuous tasks can be configured as part of a task pipeline like any other task. Let's walk through some examples of how to use these in your task pipelines.

What is a task pipeline?

A task pipeline is a series of definitions determining how tasks depend on one another. In a monorepo, you're rarely running a single task. That task may rely on the output of another task. For example, if your application depends on a buildable design system library, the design system must be built before the application. The application's build task depends on the design system's build task.

This is such a common pipeline that we include it by default when Nx workspaces are created. It's defined in your nx.json in targetDefaults:

nx.json

{
  "targetDefaults": {
    "build": {
      "dependsOn": ["^build"]
    }
  }
}

This task pipeline says that all build tasks depend on the build task of any project it depends on, also known as "descendants." The ^ indicates descendants.

targetDefaults is where you can define task pipelines for all tasks with that name, but you can also define them at the task level. This same task pipeline could be defined on an individual project:

apps/frontend/package.json

{
  "nx": {
    "targets": {
      "build": {
        "dependsOn": ["^build"]
      }
    }
  }
}

This is a brief overview of task pipelines. Be sure to check the docs for more details.

But these examples configure finite tasks: tasks that start up, produce an artifact, and then shut down. How do things change when we configure continuous tasks?

See these examples in action

To see these examples working in an actual workspace, be sure to checkout the video.

Frontend serve depends on backend serve

Assuming we run a dev target from our frontend project, and a serve target from our api project, we configure this on the frontend project like this:

apps/frontend/package.json

{
  "nx": {
    "name": "frontend",
    "targets": {
      "dev": {
        "dependsOn": [{ "projects": ["api"], "target": "serve" }]
      }
    }
  }
}

The frontend:dev task now depends on api:serve. We must also ensure the api:serve target is flagged as continuous. Tasks are already flagged as continuous if you're using inferred tasks. If your target uses an executor, you must flag those targets as continuous yourself. This is as easy as adding continuous: true to the target configuration like so:

apps/api/package.json

{
  "name": "api",
  ...
  "nx": {
    "targets": {
      "serve": {
        "continuous": true
      }
    }
  }
}

Now running frontend:dev will also result in the api:serve starting in parallel. If we look at the task graph using Nx Console or nx graph, we'll see the new task pipeline:

Graph showing connections between frontend and backend serve tasks

In addition to making for a great local development experience, e2e test suites that also run frontend:dev will have the same experience. The frontend and backend will be served at the same time, making e2e tests easier to run locally.

Configuring custom commands as continuous

So far, we've talked about tasks from Nx plugins, but what about the custom targets you've added to your project? Continuous tasks work the same way. Let's say our project has a codegen target that uses graphql-codegen. The configuration for this target looks like this:

packages/models-graphql/package.json

{
  "nx": {
    "targets": {
      "codegen": {
        "command": "npx graphql-codegen --config {projectRoot}/codegen.ts"
      }
    }
  }
}

This only allows for a static output, though: it runs once, produces the artifact, and shuts down. That works well for our build task pipeline, where we would define a task pipeline like this:

apps/frontend/package.json

{
  "nx": {
    "targets": {
      "build": {
        "dependsOn": ["^build", "codegen", "^codegen"]
      }
    }
  }
}

Any time build is run on a project, it also runs the build task for any descendants, the codegen task on the project itself, and codegen on any descendants. This ensures we have the latest version of our generated models whenever we run build on an application. We want that same experience for our local dev experience when serving the frontend application.

First, we create a continuous version of our codegen target so that now our configuration looks like this:

packages/models-graphql/package.json

{
  "nx": {
    "name": "models-graphql",
    "targets": {
      "codegen": {
        "command": "npx graphql-codegen --config {projectRoot}/codegen.ts"
      },
      "watch-codegen": {
        "continuous": true,
        "command": "npx graphql-codegen --config {projectRoot}/codegen.ts --watch"
      }
    }
  }
}

We have a new target called watch-codegen that is marked as continuous. We added the --watch flag to the command. Now, when we run watch-codegen on a project, it will watch for changes to the GraphQL schema and re-generate models. We can apply this to any project that needs it.

Now we can add dependencies from our serve targets to depend on watch-codegen:

apps/frontend/package.json

{
  "nx": {
    "name": "frontend",
    "targets": {
      "dev": {
        "dependsOn": [
          { "projects": ["api"], "target": "serve" },
          "^watch-codegen"
        ]
      },
      "serve": {
        "dependsOn": [{ "projects": ["api"], "target": "serve" }]
      }
    }
  }
}

Our frontend app may not have its own codegen target, so the serve can depend on the ^watch-codegen descendants.

And for the backend:

apps/api/package.json

{
  "nx": {
    "name": "api",
    "targets": {
      "serve": {
        "continuous": true,
        "dependsOn": ["watch-codegen", "^watch-codegen"]
      },
      "codegen": {
        "command": "npx graphql-codegen --config {projectRoot}/codegen.ts"
      },
      "watch-codegen": {
        "continuous": true,
        "command": "npx graphql-codegen --config {projectRoot}/codegen.ts --watch"
      }
    }
  }
}

Since our backend project has its own codegen target, it needs to depend on both its own watch-codegen and ^watch-codegen for its descendants.

What can continuous tasks do for you?

We've covered a few different scenarios here, and the video shows them all working inside an actual workspace. We can visualize the task graph that we've just created to see how much we've accomplished:

Graph showing connections between frontend and backend serve tasks as well as watch-codegen tasks

Now, developers can run npx nx dev frontend and have the api:serve and watch-codegen tasks run. One command, one terminal, and they are ready to work immediately. No more fumbling through multiple terminals or creating your own solution to the problem. Nx provides the tools to improve your developer experience.

What processes could you improve using continuous tasks?

Learn more: