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

# lib.wasm

- **类型：**

```ts
type Wasm =
  | {
      mode?: 'compile' | 'preserve';
    }
  | false;
```

- **默认值：**
  - 当 [bundle](/zh/config/lib/bundle.md) 为 `true` 时：`{ mode: 'compile' }`
  - 当 [bundle](/zh/config/lib/bundle.md) 为 `false` 时：`{ mode: 'preserve' }`
- **顶层配置：** 支持

配置 Rslib 如何处理 `.wasm` 模块，详见 [Wasm](/zh/guide/advanced/wasm.md)。

## wasm.mode

- **类型：** `'compile' | 'preserve'`
- **默认值：**
  - 当 [bundle](/zh/config/lib/bundle.md) 为 `true` 时：`'compile'`
  - 当 [bundle](/zh/config/lib/bundle.md) 为 `false` 时：`'preserve'`

选择 `.wasm` 模块的输出模式，详见 [Wasm - 输出模式](/zh/guide/advanced/wasm.md#输出模式)。

## 版本历史

| 版本     | 变更                                             |
| ------ | ---------------------------------------------- |
| v1.0.1 | 支持将 `lib.wasm` 设置为 `false`，以禁用对 `.wasm` 模块的处理。 |
