lib
The rs lib command uses Rslib to build library outputs.
Usage
The command loads the library configuration registered with define.lib(). When no subcommand is provided, it builds the library.
Options
rs lib supports the same library build options as Rslib. See the Rslib CLI documentation for details.
Examples:
Subcommands
inspect
rs lib inspect generates the normalized Rslib configuration and the corresponding Rsbuild and Rspack configurations for inspection.
mf-dev
rs lib mf-dev starts an Rsbuild development server for a library output that uses the Module Federation (mf) format. Use it to develop and debug the module in a host application.
Configuration
Configure library builds through define.lib() in the Rstack configuration file. It accepts the standard Rslib configuration:
rstack.config.ts