> 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.umdName

- **类型：** `string | string[] | { amd?: string, commonjs?: string, root?: string | string[] }`
- **默认值：** `undefined`

[UMD](/zh/guide/basic/output-format.md#umd) 包的导出名称。

:::tip

UMD 包的模块名称不能与全局变量名称冲突。

:::

## 示例

- 将 UMD 包挂载到 `global.MyLibrary`。

```ts title="rslib.config.ts"
export default {
  lib: [
    {
      format: 'umd',
      umdName: 'MyLibrary', // [!code highlight]
    },
  ],
};
```

- 将 UMD 包挂载到 `global.MyLibrary.Utils`。

```ts title="rslib.config.ts"
export default {
  lib: [
    {
      format: 'umd',
      umdName: ['MyLibrary', 'Utils'], // [!code highlight]
    },
  ],
};
```
