Rslib is a library development tool built on top of Rsbuild (which uses Rspack). It provides a CLI and JavaScript API to build JavaScript/TypeScript libraries in multiple output formats: ESM, CJS, UMD, IIFE, and Module Federation. It supports both bundle and bundleless modes, TypeScript declaration generation via three backends (TypeScript Compiler API, tsgo, and isolatedDeclarations), CSS processing with preprocessors and modules, static assets (including SVGR), WebAssembly, Web Workers, and Node.js single-executable applications (SEA). The architecture is plugin-based, leveraging Rsbuild's plugin system and Rspack's compilation pipeline. Key entry points include the CLI commands (`rslib build`, `rslib inspect`, `rslib mf-dev`) and the programmatic API (`createRslib`, `defineConfig`). External dependencies include Rsbuild, Rspack, SWC, Lightning CSS, TypeScript, API Extractor, and the Module Federation plugin. The monorepo contains three published packages: `@rslib/core` (core build engine), `create-rslib` (project scaffolding), and `rsbuild-plugin-dts` (declaration bundling). It includes extensive integration tests with snapshot assertions, e2e tests with Playwright, and a bilingual documentation website. The tool is designed for library authors who need multi-format builds, type declarations, and compatibility with various frameworks (React, Vue, Svelte, Solid). It is part of the Rstack ecosystem alongside Rspress, Rsdoctor, Rstest, and Rslint. Data flows: User configuration (rslib.config.ts) is parsed and merged with defaults, then passed to Rsbuild to generate Rspack configurations per output format. The build process compiles source files with SWC, extracts CSS, generates declarations, and produces final bundles. In bundleless mode, files are emitted individually with import path rewriting. The tool also supports development servers for Module Federation and watch mode for incremental builds.