close
logo
Rslib
Guide
Config
Blog
English
简体中文
Guide
Config
Blog
English
简体中文
logo
Rslib
Config Overview

Lib Configurations

lib.format
lib.bundle
lib.autoExtension
lib.autoExternal
lib.redirect
lib.syntax
lib.externalHelpers
lib.banner
lib.footer
lib.dts
lib.shims
lib.id
lib.umdName
lib.outBase

Rsbuild Configurations

logLevel
resolve
source
output
tools
plugins
📝 Edit this page on GitHub
Previous Pagelib.id
Next Pagelib.outBase

#lib.umdName

  • Type: string | string[] | { amd?: string, commonjs?: string, root?: string | string[] }
  • Default: undefined

The export name of the UMD bundle.

TIP

The module name of the UMD bundle must not conflict with the global variable name.

#Example

  • Mount the UMD bundle to global.MyLibrary.
rslib.config.ts
export default {
  lib: [
    {
      format: 'umd',
      umdName: 'MyLibrary',
    },
  ],
};
  • Mount the UMD bundle to global.MyLibrary.Utils.
rslib.config.ts
export default {
  lib: [
    {
      format: 'umd',
      umdName: ['MyLibrary', 'Utils'],
    },
  ],
};