Rslib is a library build tool powered by Rsbuild. It allows library developers to leverage the knowledge and ecosystem of webpack and Rspack. Rslib is built on top of Rsbuild's excellent configurations and plugins, providing optimal ESM and CJS output.
Rslib provides out-of-the-box configurations for library development, including compilation of TypeScript, JSX, Sass, Less, CSS Modules, and Wasm. It supports bundleless output, DTS generation (including isolated declarations), Module Federation, assets compression, type checking, PostCSS, and Lightning CSS.
In the past, we typically did not use webpack or Rspack to build ESM packages because they often included excessive runtime code, making them less friendly to package consumers. However, the community has developed a vast ecosystem around webpack and Rspack, which provides powerful features like tree shaking, code splitting, module federation and more.
So we decided to create Rslib. It improves the quality of ESM output from Rspack and webpack, leverages their extensive ecosystem, and utilizes Rsbuild's excellent out-of-the-box configuration. Rslib aims to provide a superior developer experience and explore new possibilities based on the Rspack architecture.
🚧 Rslib is still in its early stages and under active development. We are building Rslib by working in two main parts:
- bundler support track: Improve the quality of ESM / CJS outputs by contributing to Rspack and webpack.
- Rslib features track: Develop the core features of Rslib.
You can click the link above to check the progress of these tasks. The roadmap may change as we move forward.
We plan to complete the core features of Rslib in Q3 2024 and use Rslib to build our npm packages such as Rspack and Rsbuild (dogfooding). And Rslib will have a public stable version in Q4 2024.
If you're interested in Rslib, feel free to submit issues or pull requests to help us get there faster.
You can also clone the repository and run the examples in the examples folder to experience Rslib.
- Rspack: A fast Rust-based web bundler.
- Rsbuild: A high-performance build tool powered by Rspack.
- Rspress: A fast static site generator based on Rsbuild.
- Rsdoctor: A one-stop build analyzer for Rspack and Webpack.
- Modern.js: A progressive React framework based on Rsbuild.
- awesome-rspack: A curated list of awesome things related to Rspack and Rsbuild.
- rspack-examples: Examples for Rspack, Rsbuild, Rspress and Rsdoctor.
- 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 Rspack, Rsbuild, Rspress and Rsdoctor.
New contributors welcome!
Please read the Contributing Guide.
This repo has adopted the ByteDance Open Source Code of Conduct. Please check Code of Conduct for more details.
Come and chat with us on Discord! The Rstack team and users are active there, and we're always looking for contributions.
Some of the implementations of Rslib have drawn inspiration from outstanding projects in the community. We would like to express our gratitude to them:
- esbuild, created by Evan Wallace.
- tsup, created by EGOIST.
Rslib is licensed under the MIT License.