Skip to content

Commit

Permalink
docs: add why Rslib chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 committed Feb 13, 2025
1 parent ebe23ee commit 8f44d59
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions website/docs/en/guide/start/index.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Introduction

Rslib is a library development tool that leverages the well-designed configurations and plugins of [Rsbuild](https://rsbuild.dev), empowering library developers to take advantage of the extensive knowledge and ecosystem of webpack and Rspack.
Rslib is a library development tool that leverages the well-designed configurations and plugins of [Rsbuild](https://rsbuild.dev), providing an out-of-the-box development experience for library developers.

Rslib provides a comprehensive set of build features for library development, including:
## 🚀 Why Rslib

In the development of component and utility libraries, developers frequently face various build requirements. If they are not very familiar with certain build tools and solutions, additional configuration work or the simultaneous use of multiple tools is often required to achieve these requirements.

Rslib designs a complete out-of-the-box solution for library development scenarios. It allows developers to focus on writing code for actual features without spending excessive time on selecting and configuring tools. The comprehensive set of build features provided by Rslib include:

- **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.

On the other hand, developers often work on application projects, component libraries, and utility libraries concurrently. Another significant advantage of Rslib lies in its underlying use of Rspack for building, which supports the rich plugin ecosystems of both webpack and Rspack for delivering high-quality outputs. This enables the reuse and sharing of build configurations between application and library development, allowing developers to enjoy a consistent development experience while significantly reducing project maintenance costs.

## 🔥 Features

Rslib has the following features:
Expand Down
10 changes: 8 additions & 2 deletions website/docs/zh/guide/start/index.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# 介绍

Rslib 是一个库开发工具,它基于 [Rsbuild](https://rsbuild.dev/zh/) 精心设计的配置和插件,使库开发者得以复用 webpack 和 Rspack 繁荣的知识和生态系统
Rslib 是一个库开发工具,它基于 [Rsbuild](https://rsbuild.dev/zh/) 精心设计的配置和插件,为库开发者提供开箱即用的开发体验

Rslib 提供了丰富的构建功能,包括:
## 🚀 为什么选择 Rslib

在组件库和工具库的开发过程中,开发者常常面临各种构建需求,如果对一些构建工具和方案不太熟悉,往往需要额外的一些配置工作或同时使用多种工具配合来满足这些需求。

Rslib 为库开发场景设计了一套完整的开箱即用的解决方案,使开发者无需花费大量的时间在工具的选择和配置上,可以专注于库的功能开发。Rslib 提供的丰富的构建功能包括:

- **多种语言的编译**: TypeScript、JSX、Sass、Less、CSS Modules、Wasm 等。
- **灵活的构建模式**: Bundle 和 bundleless 模式以满足不同的需求。
- **多种输出格式**: ESM、CJS 和 UMD 以实现最大兼容性。
- **类型声明文件生成**: 包括 isolated declarations。
- **进阶功能**: 模块联邦、资源压缩、PostCSS、Lightning CSS 等。

另一方面,开发者通常会同时开发应用项目、组件库和工具库,Rslib 的另一个重要优势在于其底层使用 Rspack 进行构建,支持使用 webpack 和 Rspack 繁荣的插件生态输出高质量的产物,实现应用开发与库开发构建配置的复用与共享,让开发者在获得一致的开发体验的同时,显著降低项目的维护成本。

## 🔥 特性

Rslib 具备以下特性:
Expand Down

0 comments on commit 8f44d59

Please sign in to comment.