For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /config/lib/format.md.
close
  • English
  • lib.format

    • Type: 'esm' | 'cjs' | 'umd' | 'mf' | 'iife'
    • Default: 'esm'
    • CLI: --format <format> (e.g. --format umd)
    • Top-level config: Supported

    Specify the output format for the generated JavaScript output files.

    For different output formats, Rslib uses the following default value of output.library.type provided by Rspack:

    See Output Format and Module Federation for more details.

    The output format affects some of Rslib's default behavior. See Default behavior for details.

    Note

    The umd, mf and iife formats only work when bundle is set to true.