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, and this page is available as Markdown at https://rspack.rs/guide/start/quick-start.md.
close

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.

Environment preparation

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

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

Version requirements
  • Rspack v2 requires Node.js version 20.19+, 22.12+.
  • Rspack v1 requires Node.js 18.12.0 or higher.
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. 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:

npm
yarn
pnpm
bun
deno
npm create rsbuild@latest
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 to learn more.

JavaScript libraries

For JavaScript libraries that other projects consume, such as utility packages and component libraries, we recommend Rslib. 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:

npm
yarn
pnpm
bun
deno
npm create rslib@latest
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 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:

npm
yarn
pnpm
bun
deno
npm create rspack@latest
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:

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

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

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

Update your build scripts to use Rspack CLI:

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

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, 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