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 /guide/start/index.md.
close
  • English
  • Introduction

    Rslib is a library development tool based on Rsbuild.

    It gives developers a simple way to create JavaScript libraries and UI component libraries, and provides tool integrations and best practices for building, debugging, documentation, and testing throughout library development.

    Why Rslib

    During the development of component or utility libraries, developers need to focus not only on implementing project logic, but also on handling tasks that are separate from the code itself, such as building, debugging, documentation, and testing. Although many community tools and solutions can address some of these needs, developers who are not familiar with them often face cumbersome configuration requirements or need to coordinate multiple tools to meet these demands.

    Based on Rspack and Rsbuild, Rslib offers a comprehensive solution tailored to the diverse requirements of library development, effectively addressing issues such as incomplete tool ecosystems, high costs for module standard compatibility, and insufficient output optimization. Rslib optimizes webpack's limited support for library ESM outputs, reducing redundant runtime code and generating high-quality ESM outputs that are tree-shaking friendly for library consumers. Additionally, Rslib fully leverages the build performance advantages of Rspack and capitalizes the strengths of both the webpack and Rspack ecosystems to robustly support features such as Module Federation.

    Furthermore, Rslib utilizes Rsbuild's out-of-the-box configuration to facilitate configuration sharing between application and library projects, resolving the challenge of reusing build configurations between application projects and library projects, thereby reducing the configuration overhead for developers and improving development efficiency and experience.

    In the future, Rslib will explore additional possibilities by leveraging the new features of Rspack.

    Features

    Rslib has the following features:

    • Easy to configure: Rslib provides out-of-the-box tooling that enables developers to build libraries with zero configuration. It also provides a set of semantic build configurations that can be extended as project needs grow.

    • Performance-focused: Rslib is powered by Rspack and integrates high-performance Rust-based tools from the community, including SWC and Lightning CSS, delivering first-class build speed and development experience.

    • Plugin ecosystem: Rslib supports Rsbuild's official plugins and is compatible with most webpack plugins and all Rspack plugins, allowing developers to use existing community or in-house plugins in Rslib and carry over the knowledge and engineering experience they have gained in the webpack and Rspack ecosystems.

    • Flexible outputs: Rslib is designed around the diverse ways libraries are published and consumed. It supports flexibly configuring build outputs for different runtimes, distribution methods, and downstream build tools to meet the delivery needs of different types of libraries.

    • Framework agnostic: Rslib is not coupled to frontend UI frameworks. It supports React, Vue, Svelte, Solid, and other frameworks through plugins, allowing developers to build component libraries for different frameworks with a consistent configuration and development workflow.

    Rstack

    Rslib is part of Rstack, the fast, unified JavaScript toolchain for developers and agents.

    Rstack

    Rstack includes the following tools:

    NameDescriptionVersion
    RspackBundlernpm version
    RsbuildBuild toolnpm version
    RslibLibrary development toolnpm version
    RspressStatic site generatornpm version
    RsdoctorBuild analyzernpm version
    RstestTesting frameworknpm version
    RslintLinternpm version

    Community

    Come and chat with us on Discord! The Rstack team and users are active there, and we're always looking for contributions.

    Online example

    Try Rslib online with the StackBlitz example.

    Next steps

    Please read Quick start to start using Rslib.