Quick start

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

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 page to explore these ecosystem projects.

Setup environment

Rspack supports using Node.js, Deno, or Bun as the runtime.

Node.js

For Node.js, please install Node.js >= 16, it is recommended to use the Node.js LTS version.

Check the current Node.js version with the following command:

node -v

If you do not have Node.js installed in current environment, or the installed version is too low, you can use nvm or fnm to install.

Here is an example of how to install via nvm:

# Install Node.js LTS
nvm install --lts
# Switch to Node.js LTS
nvm use --lts

Create a new project

Using Rsbuild

Rsbuild is a high-performance build tool powered by Rspack and developed by the Rspack team. It provides a set of thoughtfully designed default build configs, offering an out-of-the-box development experience and can fully unleash the performance advantages of Rspack.

We recommend using Rsbuild to create new projects, simply run the following command:

npm
yarn
pnpm
bun
npm create rsbuild@latest

For more information, refer to Rsbuild - Quick start.

Using the Rspack CLI

Rspack CLI is a tool comparable to webpack CLI, offering the basic serve and build commands.

Rsbuild supports Node.js >= 16, but Rspack CLI requires Node.js version >= 18.12.0.

Run the following command to create an Rspack CLI project:

npm
yarn
pnpm
bun
npm create rspack@latest

Then follow the prompts in your terminal.

Quick creation

create-rspack and create-rsbuild provides some CLI flags. By setting these CLI flags, you can skip the interactive selection steps and create the project with one command.

For example, to create a React project in the my-project directory with one command:

# Rspack CLI
npx create-rspack --dir my-project --template react
# Rsbuild
npx create-rsbuild --dir my-project --template react
# Using abbreviations
npx create-rsbuild -d my-project -t react

Online examples

We provide an online example based on Rsbuild. The example gives an intuitive feel for the build performance of Rspack and the development experience of Rsbuild:

Manual installation

Start by creating a project directory and generating an npm `package.json':

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

Then installing @rspack/core and @rspack/cli as dev dependencies:

npm
yarn
pnpm
bun
npm add @rspack/core @rspack/cli -D

Update your build scripts to use Rspack CLI:

package.json
{
  "scripts": {
    "dev": "rspack dev",
    "build": "rspack build"
  }
}

Next, see Configure Rspack to learn about how to configure Rspack.

Migrating from existing projects

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

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:

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

Rspack community also provides install-rspack tool to easily install canary version:

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