u/brahim_-

▲ 1 r/cicd

How do you share node_modules across CI stages in an Nx monorepo without Nx Cloud?

Hi everyone,

I'm currently working as an intern, and one of my tasks is to rebuild/improve our frontend CI/CD pipeline.

We are using an Nx monorepo, and as many of you probably know, caching can become a real bottleneck.

The main issue is with node_modules, which is around ~3 GB. Right now, every stage/job in the pipeline has to download the cache again, and since we have 8 jobs, this adds a huge overhead.

I’m trying to figure out if anyone has already faced this kind of problem and found an efficient solution without using Nx Cloud.

More specifically:

- How do you handle sharing such a large node_modules dependency between stages/jobs?

- Is there a better approach than forcing each job to restore the same cache?

- Do you use artifacts, Docker layers, custom images, or another workaround?

I’d really appreciate any feedback, best practices, or real-world experiences.

Thanks!

reddit.com
u/brahim_- — 4 days ago
▲ 6 r/gitlab

How do you share node_modules across CI stages in an Nx monorepo without Nx Cloud?

Hi everyone,

I'm currently working as an intern, and one of my tasks is to rebuild/improve our frontend CI/CD pipeline.

We are using an Nx monorepo, and as many of you probably know, caching can become a real bottleneck.

The main issue is with node_modules, which is around ~3 GB. Right now, every stage/job in the pipeline has to download the cache again, and since we have 8 jobs, this adds a huge overhead.

I’m trying to figure out if anyone has already faced this kind of problem and found an efficient solution without using Nx Cloud.

More specifically:

- How do you handle sharing such a large node_modules dependency between stages/jobs?

- Is there a better approach than forcing each job to restore the same cache?

- Do you use artifacts, Docker layers, custom images, or another workaround?

I’d really appreciate any feedback, best practices, or real-world experiences.

Thanks!

reddit.com
u/brahim_- — 4 days ago
▲ 2 r/gitlab

Optimizing slow CI pipeline in Nx monorepo (40min+)

Hi everyone,

I'm currently an intern in a DevOps team, and my task is to optimize the frontend CI pipeline.

The project uses an Nx monorepo with Jest, SonarQube, and Checkmarx.

Right now, the pipeline takes 40 min to 1 hour, and I need to reduce that time without using Nx Cloud.

Main bottlenecks I found:

- Jest tests take a lot of time

- Tried flags like --maxWorkers and --runInBand with little improvement

Has anyone worked on a similar Nx CI optimization?

Any practical ideas for speeding up Jest

Thanks a lot.

reddit.com
u/brahim_- — 5 days ago