From 8f44d59d52834557922a4369295b1b8fc8e48f7b Mon Sep 17 00:00:00 2001 From: Timeless0911 <1604889533@qq.com> Date: Thu, 13 Feb 2025 17:20:17 +0800 Subject: [PATCH] docs: add why Rslib chapter --- website/docs/en/guide/start/index.mdx | 10 ++++++++-- website/docs/zh/guide/start/index.mdx | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/website/docs/en/guide/start/index.mdx b/website/docs/en/guide/start/index.mdx index 1a0159ebfb..c482b5ee23 100644 --- a/website/docs/en/guide/start/index.mdx +++ b/website/docs/en/guide/start/index.mdx @@ -1,8 +1,12 @@ # 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. @@ -10,6 +14,8 @@ Rslib provides a comprehensive set of build features for library development, in - **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: diff --git a/website/docs/zh/guide/start/index.mdx b/website/docs/zh/guide/start/index.mdx index f364eecae5..703fe61b80 100644 --- a/website/docs/zh/guide/start/index.mdx +++ b/website/docs/zh/guide/start/index.mdx @@ -1,8 +1,12 @@ # 介绍 -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 模式以满足不同的需求。 @@ -10,6 +14,8 @@ Rslib 提供了丰富的构建功能,包括: - **类型声明文件生成**: 包括 isolated declarations。 - **进阶功能**: 模块联邦、资源压缩、PostCSS、Lightning CSS 等。 +另一方面,开发者通常会同时开发应用项目、组件库和工具库,Rslib 的另一个重要优势在于其底层使用 Rspack 进行构建,支持使用 webpack 和 Rspack 繁荣的插件生态输出高质量的产物,实现应用开发与库开发构建配置的复用与共享,让开发者在获得一致的开发体验的同时,显著降低项目的维护成本。 + ## 🔥 特性 Rslib 具备以下特性: