Scaling JavaScript Monorepos at Enterprise Level: Lessons From 200+ Packages

This ad is not shown to multipass and full ticket holders
React Advanced
React Advanced 2026
October 23 - 26, 2026
London, UK & Online
Upcoming event
React Advanced 2026
React Advanced 2026
October 23 - 26, 2026. London, UK & Online
Bookmark
Rate this content
Sentry
Promoted
Code breaks, fix it faster

Crashes, slowdowns, regressions in prod. Seer by Sentry unifies traces, replays, errors, profiles to find root causes fast.

Get started

Monorepo Metamorphosis: Reducing CI Load by Over 65% with Nx, pnpm & Predictive Build Graphs

Does your CI feel slower every time your monorepo grows? In this talk, I’ll share how we transformed a 200+ project JavaScript/TypeScript monorepo by applying predictive dependency graphs, Nx task-hashing, pnpm’s content-addressable workspace, and horizontally scaled runners to eliminate redundant work and shrink build+test cycles by more than 65%. If you’re looking to break the cycle of ever-increasing CI times and unlock real delivery velocity, this session provides a clear and practical blueprint.

This talk has been presented at JSNation 2026, check out the latest edition of this JavaScript Conference.

Karthick Shanmugam
Karthick Shanmugam
22 min
15 Jun, 2026

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Introduction to monorepos metamorphosis, cutting CI load by 65%, addressing slow CI, waste in CI, and challenges in a large monorepo setup. Addressing CI issues and optimizing speed through key ideas like build creation in a large monorepo using NX to streamline package compilation and frontend deployment. Reducing blast radius in CI by optimizing compilation of micro frontends to speed up CI process and enhance efficiency. Identifying and deploying only affected micro frontends to reduce deployment overhead and enhance efficiency in compilation and deployment processes. Reducing deployment time by compiling only necessary packages and deploying essential micro frontends. Utilizing NX and TS build info output to streamline deployment processes. Implementing self-hosted runners for customized capacity allocation in CI pipelines. Utilizing NX cache to reduce network communication costs and improve CI efficiency. Implementing S3 bucket as a local cache to enhance communication and reduce costs in CI pipelines. Addressing Type Explosion issue in CI pipeline by explaining the challenges with typography components and user-defined elements. Addressing issues with jsx.intrinsic elements and barrel files in CI compilation. Introduction of AI to optimize TypeScript compilation by identifying problematic elements. Implementing type restrictions and reducing barrel files to significantly decrease compile time in CI pipelines. Introduction of PMPM for faster and simpler dependency management. Decoupling translations from CI to reduce runtime. Implementing parallelized test with NX stacks for significant time reduction in CI build and test process. Emphasizing the importance of small wins, dependency analysis, and decoupling for efficiency improvements in CI pipelines.

1. Monorepos Metamorphosis: CI Optimization

Short description:

Introduction to monorepos metamorphosis, cutting CI load by 65%, addressing slow CI, waste in CI, and challenges in a large monorepo setup.

Good evening, everyone. In the world of agentic development, where the agents are making things much faster, so should be our CI, so that it can keep up the pace with the agents. But the enterprise monorepos, they are actually growing so huge. But that would also mean that they were also slow. And hence, welcome to the talk, monorepos metamorphosis. Here you can see how we can cut your CI load by 65% for over 200 plus monorepos packages. Here I am, Kartik Shanmugam, working as a staff web platform engineer in 6th SE.

So, here, let us see what could be the problem and how we can fix it. But in general, if your CI pipeline is running too slow, then that would mean it might be lying to you. The first thought, what could come to our mind, is maybe we can increase the capacity. But no, that is not the problem. The problem is waste. In our CI, maybe we have a lot of waste that is running on, that is consuming more bandwidth, more power, and hence, the CI might be running too slow.

So, what we had, we have a large TypeScript platform. We have a monorepo with 200 plus packages with 70 plus micro frontends. And here, we have 10 plus product teams who are contributing to this monorepo. So, imagine, in such a huge monorepo, a single change in core libraries, whatever we have, this took around 75 minutes, which is almost one and a half hours, to run the entire CI and then make the product to be available for the testers or for the developers, or for the product team to validate it. But 75 minutes, it's actually huge. For even a single commit, you need to wait for that amount of time.

2. CI Speed Optimization in Monorepos

Short description:

Addressing CI issues and optimizing speed through key ideas like build creation in a large monorepo using NX to streamline package compilation and frontend deployment.

So, we thought, okay, this is not good. So, then we had various ideas on how to fix it. And so, we ended up with three main ideas which could help us in targeting this particular CI failure, CI slowness, and that helped us to improve our CI speed by over 65%. Let's dive deep into each of these ideas, like what did we do, and what is the result, what we got from that idea.

The first big idea, what we had, is creating the build. So, as I already told you, we have this 200 plus package monorepo with 70 plus micro frontends. Package monorepo with 70 plus micro frontends. And before NX, yes, for every commit, we would need to run the compile command for all the 200 plus packages, and then we need to deploy all 70 plus micro frontends. But why do we do the compile command? Because if in case there are any issues or errors that come up, since we have this static compiler, that would catch the issues beforehand before even going to deploy. So, for that reason, we had this compile command, and it was running good.

Thanks to NX. With NX, we were able to cut it down by half. But how did we so what did NX help over here? Say, for example, you have a file called price.ts, and that is in the core package. And this core package is being used as a dependency in 100 plus packages. And among that 100 plus packages, we have 40 plus micro frontends. So, with the help of NX, we were able to identify what are the affected packages for that particular change. I just reiterate, the affected packages, but not the originally affected packages. So, here, on a single change on price.ts, we could observe that the 100 plus packages were being affected. So, we would compile all the 100 plus packages. And then from that, we identified that 40 plus micro frontends have to be deployed. So, then we deployed those 40 plus micro frontends.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Levelling up Monorepos with npm Workspaces
DevOps.js Conf 2022DevOps.js Conf 2022
33 min
Levelling up Monorepos with npm Workspaces
Top Content
NPM workspaces help manage multiple nested packages within a single top-level package, improving since the release of NPM CLI 7.0. You can easily add dependencies to workspaces and handle duplications. Running scripts and orchestration in a monorepo is made easier with NPM workspaces. The npm pkg command is useful for setting and retrieving keys and values from package.json files. NPM workspaces offer benefits compared to Lerna and future plans include better workspace linking and adding missing features.
Automating All the Code & Testing Things with GitHub Actions
React Advanced 2021React Advanced 2021
19 min
Automating All the Code & Testing Things with GitHub Actions
Top Content
We will learn how to automate code and testing with GitHub Actions, including linting, formatting, testing, and deployments. Automating deployments with scripts and Git hooks can help avoid mistakes. Popular CI-CD frameworks like Jenkins offer powerful orchestration but can be challenging to work with. GitHub Actions are flexible and approachable, allowing for environment setup, testing, deployment, and custom actions. A custom AppleTools Eyes GitHub action simplifies visual testing. Other examples include automating content reminders for sharing old content and tutorials.
Fine-tuning DevOps for People over Perfection
DevOps.js Conf 2022DevOps.js Conf 2022
33 min
Fine-tuning DevOps for People over Perfection
Top Content
DevOps is a journey that varies for each company, and remote work makes transformation challenging. Pull requests can be frustrating and slow, but success stories like Mateo Colia's company show the benefits of deploying every day. Challenges with tools and vulnerabilities require careful consideration and prioritization. Investing in documentation and people is important for efficient workflows and team growth. Trust is more important than excessive control when deploying to production.
Why is CI so Damn Slow?
DevOps.js Conf 2022DevOps.js Conf 2022
27 min
Why is CI so Damn Slow?
Slow CI has a negative impact on productivity and finances. Debugging CI workflows and tool slowness is even worse. Dependencies impact CI and waiting for NPM or YARN is frustrating. The ideal CI job involves native programs for static jobs and lightweight environments for dynamic jobs. Improving formatter performance and linting is a priority. Performance optimization and fast tools are essential for CI and developers using slower hardware.
End the Pain: Rethinking CI for Large Monorepos
DevOps.js Conf 2024DevOps.js Conf 2024
25 min
End the Pain: Rethinking CI for Large Monorepos
Today's Talk discusses rethinking CI in monorepos, with a focus on leveraging the implicit graph of project dependencies to optimize build times and manage complexity. The use of NX Replay and NX Agents is highlighted as a way to enhance CI efficiency by caching previous computations and distributing tasks across multiple machines. Fine-grained distribution and flakiness detection are discussed as methods to improve distribution efficiency and ensure a clean setup. Enabling distribution with NX Agents simplifies the setup process, and NX Cloud offers dynamic scaling and cost reduction. Overall, the Talk explores strategies to improve the scalability and efficiency of CI pipelines in monorepos.
The Zen of Yarn
DevOps.js Conf 2022DevOps.js Conf 2022
31 min
The Zen of Yarn
Let's talk about React and TypeScript, Yarn's philosophy and long-term relevance, stability and error handling in Yarn, Yarn's behavior and open source sustainability, investing in maintenance and future contributors, contributing to the JavaScript ecosystem, open-source contribution experience, maintaining naming consistency in large projects, version consistency and strictness in Yarn, and Yarn 4 experiments for performance improvement.

Workshops on related topic

Deploying React Native Apps in the Cloud
React Summit 2023React Summit 2023
88 min
Deploying React Native Apps in the Cloud
Top Content
WorkshopFree
Cecelia Martinez
Cecelia Martinez
Deploying React Native apps manually on a local machine can be complex. The differences between Android and iOS require developers to use specific tools and processes for each platform, including hardware requirements for iOS. Manual deployments also make it difficult to manage signing credentials, environment configurations, track releases, and to collaborate as a team.
Appflow is the cloud mobile DevOps platform built by Ionic. Using a service like Appflow to build React Native apps not only provides access to powerful computing resources, it can simplify the deployment process by providing a centralized environment for managing and distributing your app to multiple platforms. This can save time and resources, enable collaboration, as well as improve the overall reliability and scalability of an app.
In this workshop, you’ll deploy a React Native application for delivery to Android and iOS test devices using Appflow. You’ll also learn the steps for publishing to Google Play and Apple App Stores. No previous experience with deploying native applications is required, and you’ll come away with a deeper understanding of the mobile deployment process and best practices for how to use a cloud mobile DevOps platform to ship quickly at scale.
MERN Stack Application Deployment in Kubernetes
DevOps.js Conf 2022DevOps.js Conf 2022
152 min
MERN Stack Application Deployment in Kubernetes
Workshop
Joel Lord
Joel Lord
Deploying and managing JavaScript applications in Kubernetes can get tricky. Especially when a database also has to be part of the deployment. MongoDB Atlas has made developers' lives much easier, however, how do you take a SaaS product and integrate it with your existing Kubernetes cluster? This is where the MongoDB Atlas Operator comes into play. In this workshop, the attendees will learn about how to create a MERN (MongoDB, Express, React, Node.js) application locally, and how to deploy everything into a Kubernetes cluster with the Atlas Operator.
Azure Static Web Apps (SWA) with Azure DevOps
DevOps.js Conf 2022DevOps.js Conf 2022
13 min
Azure Static Web Apps (SWA) with Azure DevOps
Workshop
Juarez Barbosa Junior
Juarez Barbosa Junior
Azure Static Web Apps were launched earlier in 2021, and out of the box, they could integrate your existing repository and deploy your Static Web App from Azure DevOps. This workshop demonstrates how to publish an Azure Static Web App with Azure DevOps.
How to develop, build, and deploy Node.js microservices with Pulumi and Azure DevOps
DevOps.js Conf 2022DevOps.js Conf 2022
163 min
How to develop, build, and deploy Node.js microservices with Pulumi and Azure DevOps
Workshop
Alex Korzhikov
Andrew Reddikh
2 authors
The workshop gives a practical perspective of key principles needed to develop, build, and maintain a set of microservices in the Node.js stack. It covers specifics of creating isolated TypeScript services using the monorepo approach with lerna and yarn workspaces. The workshop includes an overview and a live exercise to create cloud environment with Pulumi framework and Azure services. The sessions fits the best developers who want to learn and practice build and deploy techniques using Azure stack and Pulumi for Node.js.