Rslib
Create JavaScript libraries in a simple and intuitive way.
Rslib is a library development tool that leverages the well-designed configurations and plugins of [Rsbuild](https://rsbuild.rs), empowering library developers to take advantage of the extensive knowledge and ecosystem of webpack and Rspack. The project is written primarily in TypeScript, distributed under the MIT License license, first published in 2024. Key topics include: build-tool, bundler, frontend, javascript, library.
Rslib
<p> <a href="https://discord.gg/FQfm7VqU"><img src="https://img.shields.io/badge/chat-discord-blue?style=flat-square&logo=discord&colorA=564341&colorB=F8F5FF" alt="Discord channel" /></a> <a href="https://npmjs.com/package/@rslib/core?activeTab=readme"><img src="https://img.shields.io/npm/v/@rslib/core?style=flat-square&colorA=564341&colorB=F8F5FF" alt="npm version" /></a> <a href="https://npmcharts.com/compare/@rslib/core?minimal=true"><img src="https://img.shields.io/npm/dm/@rslib/core.svg?style=flat-square&colorA=564341&colorB=F8F5FF" alt="downloads" /></a> <a href="https://nodejs.org/en/about/previous-releases"><img src="https://img.shields.io/node/v/@rslib/core.svg?style=flat-square&colorA=564341&colorB=F8F5FF" alt="node version"></a> <a href="https://github.com/web-infra-dev/rslib/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=F8F5FF" alt="license" /></a> <a href="https://deepwiki.com/web-infra-dev/rslib"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki" /></a> </p>English | ็ฎไฝไธญๆ
Rslib is a library development tool that leverages the well-designed configurations and plugins of Rsbuild, empowering library developers to take advantage of the extensive knowledge and ecosystem of webpack and Rspack.
Rslib aims to provide library developers with:
- Easy Library Creation: Easily create high-quality JavaScript and TypeScript libraries in a simple and intuitive way.
- Simple Build Configuration: Provides out-of-the-box build capabilities to meet the diverse needs of library development scenarios with simple configurations.
- Comprehensive Development Workflow: Contains best practices for building, debugging, documentation, and testing during library development to help improve development efficiency and experience.
๐ฅ Features
Rslib has the following features:
- Compilation of diverse languages: TypeScript, JSX, Sass, Less, CSS Modules, Wasm, and more.
- Flexible build modes: Bundle and bundleless options to meet varying needs.
- Multiple output formats: ESM, CJS, and UMD for maximum compatibility.
- Declaration file generation: Including isolated declarations.
- Advanced features: Module Federation, asset compression, PostCSS, Lightning CSS, and more.
๐ Documentation
๐ฏ Ecosystem
Rslib is implemented based on Rsbuild and fully reuses the capabilities and ecosystem of Rsbuild.
The following diagram illustrates the relationship between Rslib and other tools in the ecosystem:
<img src="https://assets.rspack.rs/rsbuild/assets/rspack-stack-layers.png" alt="Rspack stack layers" width="760" />๐ Getting started
To get started with Rslib, see the Quick start.
๐ฆ Rstack
Rstack is a unified JavaScript toolchain centered on Rspack, with high performance and consistent architecture.
| Name | Description | Version |
|---|---|---|
| Rspack | Bundler | <a href="https://npmjs.com/package/@rspack/core"><img src="https://img.shields.io/npm/v/@rspack/core?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /></a> |
| Rsbuild | Build tool | <a href="https://npmjs.com/package/@rsbuild/core"><img src="https://img.shields.io/npm/v/@rsbuild/core?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /></a> |
| Rslib | Library development tool | <a href="https://npmjs.com/package/@rslib/core"><img src="https://img.shields.io/npm/v/@rslib/core?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /></a> |
| Rspress | Static site generator | <a href="https://npmjs.com/package/@rspress/core"><img src="https://img.shields.io/npm/v/@rspress/core?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /></a> |
| Rsdoctor | Build analyzer | <a href="https://npmjs.com/package/@rsdoctor/core"><img src="https://img.shields.io/npm/v/@rsdoctor/core?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /></a> |
| Rstest | Testing framework | <a href="https://npmjs.com/package/@rstest/core"><img src="https://img.shields.io/npm/v/@rstest/core?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /></a> |
| Rslint | Linter | <a href="https://npmjs.com/package/@rslint/core"><img src="https://img.shields.io/npm/v/@rslint/core?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /></a> |
๐ Links
- awesome-rstack: A curated list of awesome things related to Rstack.
- agent-skills: A collection of Agent Skills for Rstack.
- rstack-examples: Examples for Rstack.
- storybook-rsbuild: Storybook builder powered by Rsbuild.
- rsbuild-plugin-template: Use this template to create your own Rsbuild plugin.
- rstack-design-resources: Design resources for Rstack.
๐ค Contribution
[!NOTE]
We highly value any contributions to Rslib!
Please read the Contributing Guide.
Contributors
<a href="https://github.com/web-infra-dev/rslib/graphs/contributors" target="_blank"> <img src="https://contrib.rocks/image?repo=web-infra-dev/rslib&columns=24"> </a>Code of conduct
This repo has adopted the ByteDance Open Source Code of Conduct. Please check Code of Conduct for more details.
๐งโ๐ป Community
Come and chat with us on Discord! The Rstack team and users are active there, and we're always looking for contributions.
๐ Credits
Parts of Rslib are derived from or inspired by many excellent open source projects. We sincerely appreciate the work of these projects and the ideas they have shared with the community:
๐ License
Rslib is licensed under the MIT License.
Contributors
Showing top 12 contributors by commit count.
