> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# Rsbuild

[Rsbuild](https://rsbuild.rs) is a build tool powered by Rspack for developing web applications. It provides common build features out of the box and supports frameworks such as React and Vue through plugins.

If your application uses Rsbuild, you can use Rstest to test it and reuse the test-relevant parts of your Rsbuild configuration through an adapter. This reduces duplicate configuration and helps keep test compilation consistent with your application build.

## Quick start

### New project

Create a new Rsbuild + Rstest project with the `--tools rstest` flag:

```bash
npm create rsbuild@latest -- --tools rstest
```

The scaffold includes Rstest and demo tests. Run them with `npm run test`.

### Existing project

To add Rstest to an existing project, follow the [Quick Start](/guide/start/quick-start.md) to install and set up test scripts.

## Reuse Rsbuild config

[@rstest/adapter-rsbuild](https://www.npmjs.com/package/@rstest/adapter-rsbuild) loads your Rsbuild config and converts the test-relevant parts into Rstest configuration.

### Install adapter


```sh [npm]
npm add @rstest/adapter-rsbuild -D
```

```sh [yarn]
yarn add @rstest/adapter-rsbuild -D
```

```sh [pnpm]
pnpm add @rstest/adapter-rsbuild -D
```

```sh [bun]
bun add @rstest/adapter-rsbuild -D
```

```sh [deno]
deno add npm:@rstest/adapter-rsbuild -D
```

### Extend your config

```ts title="rstest.config.ts"
import { defineConfig } from '@rstest/core';
import { withRsbuildConfig } from '@rstest/adapter-rsbuild';

export default defineConfig({
  extends: withRsbuildConfig(),
});
```

The adapter loads `rsbuild.config.ts`, maps options used by test compilation, merges them with your Rstest config, and adds the loaded config file to [`forceRerunTriggers`](/config/test/force-rerun-triggers.md), so `--changed` runs the full test suite when that config changes. It also removes the `rsbuild:type-check` plugin because type checking does not run in the test pipeline.

It does not copy build-only settings such as `dev`, `server`, or `html`. Use `cwd`, `config`, or `environmentName` when the default config location or environment does not match your project.

If another tool already creates an Rsbuild config object in memory, use `toRstestConfig` instead of loading a config file. See the [configuration reference](/integration/rsbuild/reference.md) for both entry points, options, mapping, and debug instructions.

## Related documentation

- [Rsbuild configuration overview](https://rsbuild.rs/config)
