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

# Building

请查看 [准备工作](https://rspack.rs/zh/contribute/development/prerequisites.md) 安装 Rust 和 Node.js 环境。

## 安装 Node.js 依赖

通过 [pnpm](https://pnpm.io/) 安装 Node.js 依赖。

```bash
# enable pnpm with corepack
corepack enable

# Install dependencies
pnpm i
```

## 构建 Rspack

- 执行 `cargo build` 编译 Rust 代码。
- 执行 `pnpm run build:cli:dev` 编译 Node.js 和 Rust 代码。
- 如果想要构建 Rspack Wasm，执行 `pnpm run build:cli:dev:wasm`

被编译的二进制产物位于 `packages/rspack-cli/bin/rspack` 。
