> For the complete documentation index, see [llms.txt](https://argos-ci.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://argos-ci.com/docs/learn/how-to-guides/ci-pipelines/monorepos-setup.md).

# Monorepos setup

## Leveraging Build Splitting in Monorepos

Monorepos, containing multiple packages or applications, can greatly benefit from Argos's build splitting feature. This allows for distinct visual testing builds within the same commit, catering to diverse screenshot categories such as component libraries and end-to-end (E2E) tests.

Argos supports build splitting across all SDKs, offering a streamlined approach to manage visual tests for different parts of your monorepo. By specifying a unique build name for each category of screenshots, you can isolate and target tests more effectively.

## Practical Application

Imagine your monorepo includes both a component library and an application undergoing E2E testing. You can differentiate these test suites in Argos by assigning a unique `build-name` to each, ensuring clear separation and organization of visual tests. This is achieved by setting the `buildName` option in your Argos integration, as shown in the examples below for both component screenshots and E2E tests:

**For components:**

{% tabs %}
{% tab title="npm" %}

```
npm exec -- argos upload --build-name components ./screenshots/components
```

{% endtab %}

{% tab title="yarn" %}

```
yarn run argos upload --build-name components ./screenshots/components
```

{% endtab %}

{% tab title="pnpm" %}

```
pnpm exec -- argos upload --build-name components ./screenshots/components
```

{% endtab %}

{% tab title="bun" %}

```
bun x argos upload --build-name components ./screenshots/components
```

{% endtab %}
{% endtabs %}

**For E2E tests with Playwright:**

{% code title="playwright.config.ts" %}

```ts
import { defineConfig } from "@playwright/test";

export default defineConfig({
  reporter: [
    process.env.CI ? ["dot"] : ["list"],
    [
      "@argos-ci/playwright/reporter",
      {
        uploadToArgos: !!process.env.CI,
        token: "<YOUR-ARGOS-TOKEN>",
        buildName: "e2e",
      },
    ],
  ],
  // Other config
});
```

{% endcode %}

This approach not only enhances the clarity of your visual testing efforts in a monorepo context but also improves the efficiency of identifying and addressing potential visual regressions across different scopes of your project.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://argos-ci.com/docs/learn/how-to-guides/ci-pipelines/monorepos-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
