rslib

Community

Fast Rspack library builds with Module Federation

AuthorHyperxq
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: rslib
Download link: https://github.com/Hyperxq/modular-frontend-architecture/archive/main.zip#rslib

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.