---
title: Rsbuild
description: Learn more about using Rsbuild in your monorepo.
product: turborepo
type: integration
summary: Add and configure Rsbuild applications in your Turborepo monorepo.
related:
  - /docs/guides/frameworks/framework-bindings
  - /docs/guides/microfrontends
  - /docs/guides/frameworks/vite
---

# Rsbuild

[Rsbuild](https://rsbuild.rs/) is an Rspack-based build tool that provides out-of-the-box setup for modern web applications.

Quickstart [#quickstart]

To get started with Rsbuild in a Turborepo quickly, use [the `with-rsbuild` example](https://github.com/vercel/turborepo/tree/main/examples/with-rsbuild):

<PackageManagerTabs>
  <Tab value="pnpm">
    ```bash title="Terminal"
    pnpm dlx create-turbo@latest -e with-rsbuild
    ```
  </Tab>

  <Tab value="yarn">
    ```bash title="Terminal"
    yarn dlx create-turbo@latest -e with-rsbuild
    ```
  </Tab>

  <Tab value="npm">
    ```bash title="Terminal"
    npx create-turbo@latest -e with-rsbuild
    ```
  </Tab>

  <Tab value="bun">
    ```bash title="Terminal"
    bunx create-turbo@latest -e with-rsbuild
    ```
  </Tab>
</PackageManagerTabs>

Adding an Rsbuild application to an existing repository [#adding-an-rsbuild-application-to-an-existing-repository]

Use [`create-rsbuild`](https://rsbuild.rs/guide/start/quick-start) to set up a new Rsbuild application in a package. From the root of your repository, run:

<PackageManagerTabs>
  <Tab value="pnpm">
    ```bash title="Terminal"
    pnpm dlx create-rsbuild@latest apps/my-app --template react
    ```
  </Tab>

  <Tab value="yarn">
    ```bash title="Terminal"
    yarn dlx create-rsbuild@latest apps/my-app --template react
    ```
  </Tab>

  <Tab value="npm">
    ```bash title="Terminal"
    npx -y create-rsbuild@latest apps/my-app --template react
    ```
  </Tab>

  <Tab value="bun">
    ```bash title="Terminal"
    bunx create-rsbuild@latest apps/my-app --template react
    ```
  </Tab>
</PackageManagerTabs>

Integrating with your repository [#integrating-with-your-repository]

To add [Internal Packages](/docs/core-concepts/internal-packages) to your new application, install them into the app with your package manager:

<PackageManagerTabs>
  <Tab value="pnpm">
    ```diff title="./apps/my-app/package.json"
    {
      "name": "my-app",
      "dependencies": {
    +   "@repo/ui": "workspace:*"
      }
    }
    ```
  </Tab>

  <Tab value="yarn">
    ```diff title="./apps/my-app/package.json"
    {
      "name": "my-app",
      "dependencies": {
    +   "@repo/ui": "*"
      }
    }
    ```
  </Tab>

  <Tab value="npm">
    ```diff title="./apps/my-app/package.json"
    {
     "name": "my-app",
      "dependencies": {
    +   "@repo/ui": "*"
      }
    }
    ```
  </Tab>

  <Tab value="bun">
    ```diff title="./apps/my-app/package.json"
    {
     "name": "my-app",
      "dependencies": {
    +   "@repo/ui": "workspace:*"
      }
    }
    ```
  </Tab>
</PackageManagerTabs>

Make sure to run your package manager's install command. You also may need to update `scripts` in `package.json` to fit your use case in your repository.

Customizing tasks [#customizing-tasks]

By default, the new application will use the tasks defined in the root `turbo.json`. If you'd like to configure tasks differently for the new application, use [Package Configurations](/docs/reference/package-configurations).

Microfrontends [#microfrontends]

When using Rsbuild with [Turborepo's microfrontends](/docs/guides/microfrontends), set `server.base` for child applications. Rsbuild uses `server.base` as the default asset prefix for both development and production assets.

```ts title="./apps/my-app/rsbuild.config.ts"

export default defineConfig({
  server: {
    base: "/admin",
  },
});
```

Module Federation [#module-federation]

For runtime composition with Rsbuild, use [the `with-rsbuild-module-federation` example](https://github.com/vercel/turborepo/tree/main/examples/with-rsbuild-module-federation).

<PackageManagerTabs>
  <Tab value="pnpm">
    ```bash title="Terminal"
    pnpm dlx create-turbo@latest -e with-rsbuild-module-federation
    ```
  </Tab>

  <Tab value="yarn">
    ```bash title="Terminal"
    yarn dlx create-turbo@latest -e with-rsbuild-module-federation
    ```
  </Tab>

  <Tab value="npm">
    ```bash title="Terminal"
    npx create-turbo@latest -e with-rsbuild-module-federation
    ```
  </Tab>

  <Tab value="bun">
    ```bash title="Terminal"
    bunx create-turbo@latest -e with-rsbuild-module-federation
    ```
  </Tab>
</PackageManagerTabs>

The example includes a `react-host` Rsbuild app, a `react-remote` Rsbuild app, and an `@mf-rsbuild-example/shared-ui` package. The host consumes the remote's exposed `./remote-app` module through `mf-manifest.json`, and both apps share React dependencies through [Module Federation](https://module-federation.io/).

During development, run `turbo dev` from the example root. The host uses Rsbuild's default port `3000` and the remote runs on `localhost:3001`.

```json title="./turbo.json"
{
  "tasks": {
    "dev": {
      "cache": false,
      "persistent": true,
      "dependsOn": ["^build"]
    },
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", "*.tsbuildinfo"]
    }
  }
}
```

Keep `dev` uncached and persistent for Rsbuild servers. Use `dependsOn: ["^build"]` so shared packages are built before the host and remote start.

---

[View full sitemap](/sitemap.md)