What problem does it solve?
Rslib codifies reliable, high-performance library build patterns for Rspack-based component libraries so teams avoid brittle manual configs, slow builds, and runtime bundle drift when using Module Federation.
Core Features & Use Cases
- Auto-discovered entries: Use fast-glob to discover component entries so new components are included automatically without manual registration.
- Multi-target outputs: Produce Module Federation remotes, ESM, and CJS artifacts to support runtime sharing, native import maps, and npm consumers.
- Build hygiene: Enforce tsconfig.build.json, exclude tests, gate .d.ts generation to local dev, and require peerDependencies to keep output zero-runtime.
- Use Case: Build a UI component library that exposes each component as an independent MF remote entry for a Preact shell while also shipping tree-shakable ESM packages.
Quick Start
Run the rslib build command in your library package to produce Module Federation, ESM, and CJS outputs with auto-discovered component entries.