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

# Quick start

Get up to speed quickly with a new Rspack based project.

- [Create a new project](#create-a-new-project): Choose the right tool to create a new project powered by Rspack.
- [Migrating from existing projects](#migrating-from-existing-projects): Migrate from a webpack-based project to Rspack.

## Ecosystem

As a low-level bundler, Rspack has a rich ecosystem that includes various frameworks, tools, and solutions. These ecosystem projects cover different aspects from frameworks to development tools, meeting diverse development needs across scenarios and providing an out-of-the-box experience.

See the [Ecosystem](https://rspack.rs/guide/start/ecosystem.md) page to explore these ecosystem projects.

## Environment preparation

Rspack supports using [Node.js](https://nodejs.org/), [Deno](https://deno.com/), or [Bun](https://bun.sh/) as the JavaScript runtime.

You can refer to the following installation guides and choose one runtime:

- [Install Node.js](https://nodejs.org/en/download)
- [Install Bun](https://bun.com/docs/installation)
- [Install Deno](https://docs.deno.com/runtime/getting_started/installation/)

:::tip Version requirements

- Rspack v2 requires Node.js version 20.19+, 22.12+.
- Rspack v1 requires Node.js 18.12.0 or higher.

:::

:::details For unsupported platforms

If you are using a niche platform, Rspack may not provide native support for it. In this case, please manually install `@rspack/binding-wasm32-wasi` as a fallback. The Wasm build is compatible with most platforms.

Currently supported platforms:

- `darwin-arm64`
- `darwin-x64`
- `linux-arm64-gnu`
- `linux-arm64-musl`
- `linux-riscv64-gnu`
- `linux-riscv64-musl`
- `linux-ppc64-gnu`
- `linux-s390x-gnu`
- `linux-x64-gnu`
- `linux-x64-musl`
- `win32-arm64-msvc`
- `win32-ia32-msvc`
- `win32-x64-msvc`

:::

## Create a new project

### Web applications

For web applications, we recommend [Rsbuild](https://rsbuild.rs/). It builds on Rspack with defaults for common build tasks, a dev server, and integrations for frameworks such as React and Vue to help you start developing quickly. You can customize the build through configuration and plugins, or adjust the underlying Rspack configuration.

Run the following command and follow the prompts:


```sh [npm]
npm create rsbuild@latest
```

```sh [yarn]
yarn create rsbuild
```

```sh [pnpm]
pnpm create rsbuild@latest
```

```sh [bun]
bun create rsbuild@latest
```

```sh [deno]
deno init --npm rsbuild@latest
```

:::tip Non-interactive mode

To skip interactive prompts, specify a directory and template, for example: `npx -y create-rsbuild --dir my-app --template react`.

:::

> See [Rsbuild - Quick start](https://rsbuild.rs/guide/start/quick-start) to learn more.

### JavaScript libraries

For JavaScript libraries that other projects consume, such as utility packages and component libraries, we recommend [Rslib](https://rslib.rs/). It builds on Rsbuild with defaults for library development and supports generating ESM and CommonJS output and TypeScript declarations, so you can publish your library to npm or share it across projects.

Run the following command and follow the prompts:


```sh [npm]
npm create rslib@latest
```

```sh [yarn]
yarn create rslib
```

```sh [pnpm]
pnpm create rslib@latest
```

```sh [bun]
bun create rslib@latest
```

```sh [deno]
deno init --npm rslib@latest
```

:::tip Non-interactive mode

To skip interactive prompts, specify a directory and template, for example: `npx -y create-rslib --dir my-lib --template node-js`.

:::

> See [Rslib - Quick start](https://rslib.rs/guide/start/quick-start) to learn more.

### Using Rspack CLI directly

If you want to set up your own build workflow and manage the Rspack configuration directly, you can use Rspack CLI. It provides development, build, and preview commands, while you choose and configure loaders, plugins, and other build capabilities yourself.

#### Using a scaffold

Run the following command and follow the prompts to create a project from a template:


```sh [npm]
npm create rspack@latest
```

```sh [yarn]
yarn create rspack
```

```sh [pnpm]
pnpm create rspack@latest
```

```sh [bun]
bun create rspack@latest
```

```sh [deno]
deno init --npm rspack@latest
```

:::tip Non-interactive mode

To skip interactive prompts, specify a directory and template, for example: `npx -y create-rspack --dir my-app --template react`.

:::

#### Manual installation

You can also install Rspack CLI and create a configuration file manually. Start by creating a project directory and generating an npm `package.json` file:

```bash
mkdir rspack-demo
cd rspack-demo
npm init -y
```

Then install [@rspack/core](https://www.npmjs.com/package/@rspack/core) and [@rspack/cli](https://www.npmjs.com/package/@rspack/cli) as dev dependencies:


```sh [npm]
npm add @rspack/core @rspack/cli -D
```

```sh [yarn]
yarn add @rspack/core @rspack/cli -D
```

```sh [pnpm]
pnpm add @rspack/core @rspack/cli -D
```

```sh [bun]
bun add @rspack/core @rspack/cli -D
```

```sh [deno]
deno add npm:@rspack/core npm:@rspack/cli -D
```

Update your build scripts to use Rspack CLI:

```js title="package.json"
{
  "scripts": {
    "dev": "rspack dev",
    "build": "rspack build",
    "preview": "rspack preview"
  }
}
```

Next, see [Configure Rspack](https://rspack.rs/config/index.md) to learn about how to configure Rspack.

## Migrating from existing projects

If you need to migrate from an existing project to Rspack, you can refer to the following guides:

- [Migrating from webpack to Rspack](https://rspack.rs/guide/migration/webpack.md)
- [Migrating from webpack to Rsbuild](https://rsbuild.rs/guide/migration/webpack)
- [Migrating from Create React App to Rsbuild](https://rsbuild.rs/guide/migration/cra)
- [Migrating from Vue CLI to Rsbuild](https://rsbuild.rs/guide/migration/vue-cli)
- [Migrating from Vite to Rsbuild](https://rsbuild.rs/guide/migration/vite)
- [Migrating from Tsup to Rslib](https://rslib.rs/guide/migration/tsup)
- [Migrating from Storybook](https://rspack.rs/guide/migration/storybook.md)

## Install canary version

When you need to test or verify the features of Rspack that are not yet released to the stable version, you may need to use the canary version.

The canary version of Rspack has a `-canary` suffix in the package scope. For example, the canary package name of `@rspack/core` is `@rspack-canary/core`. To use these versions, you can configure the overrides of the package manager (npm/yarn/pnpm/bun).

Here is an example of using pnpm overrides:

```json title="package.json"
{
  "pnpm": {
    "overrides": {
      "@rspack/core": "npm:@rspack-canary/core@latest"
    },
    "peerDependencyRules": {
      "allowAny": ["@rspack/*"]
    }
  }
}
```

Rspack community also provides [install-rspack](https://github.com/rstackjs/install-rspack) tool to easily install canary version:

```shell
npx install-rspack --version latest # Install the latest version
npx install-rspack --version canary # Install the canary version
npx install-rspack --version 1.0.0-canary-d614005-20250101082730 # Install the specified canary version
```
