Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<picture>
<img alt="Rslib Banner" src="https://assets.rspack.dev/rslib/rslib-banner.png">
<img alt="Rslib Banner" src="https://assets.rspack.rs/rslib/rslib-banner.png">
</picture>

# Rslib
Expand All @@ -14,7 +14,7 @@

English | [简体中文](./README.zh-CN.md)

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.rs), empowering library developers to take advantage of the extensive knowledge and ecosystem of webpack and Rspack.

Rslib aims to provide library developers with:

Expand All @@ -38,7 +38,7 @@ Rslib is implemented based on Rsbuild and fully reuses the capabilities and ecos

The following diagram illustrates the relationship between Rslib and other tools in the ecosystem:

<img src="https://assets.rspack.dev/rsbuild/assets/rspack-stack-layers.png" alt="Rspack stack layers" width="760" />
<img src="https://assets.rspack.rs/rsbuild/assets/rspack-stack-layers.png" alt="Rspack stack layers" width="760" />

## 📚 Getting started

Expand Down
6 changes: 3 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<picture>
<img alt="Rslib Banner" src="https://assets.rspack.dev/rslib/rslib-banner.png">
<img alt="Rslib Banner" src="https://assets.rspack.rs/rslib/rslib-banner.png">
</picture>

# Rslib
Expand All @@ -14,7 +14,7 @@

[English](./README.md) | 简体中文

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

Rslib 旨在为库开发者提供:

Expand All @@ -38,7 +38,7 @@ Rslib 基于 Rsbuild 实现,并完全复用 Rsbuild 的能力和生态系统

下图说明了 Rsbuild 与生态中其他工具之间的关系:

<img src="https://assets.rspack.dev/rsbuild/assets/rspack-stack-layers.png" alt="Rspack stack layers" width="760" />
<img src="https://assets.rspack.rs/rsbuild/assets/rspack-stack-layers.png" alt="Rspack stack layers" width="760" />

## 📚 快速上手

Expand Down
4 changes: 2 additions & 2 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<picture>
<img alt="Rslib Banner" src="https://assets.rspack.dev/rslib/rslib-banner.png">
<img alt="Rslib Banner" src="https://assets.rspack.rs/rslib/rslib-banner.png">
</picture>

# Rslib

Rslib is a library development tool powered by [Rsbuild](https://rsbuild.dev). It allows library developers to leverage the knowledge and ecosystem of webpack and Rspack.
Rslib is a library development tool powered by [Rsbuild](https://rsbuild.rs). It allows library developers to leverage the knowledge and ecosystem of webpack and Rspack.

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/css/cssConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const require = createRequire(import.meta.url);

export const RSLIB_CSS_ENTRY_FLAG = '__rslib_css__';

// https://rsbuild.dev/config/output/css-modules#cssmodulesauto
// https://rsbuild.rs/config/output/css-modules#cssmodulesauto
export type CssLoaderOptionsAuto = CSSLoaderOptions['modules'] extends infer T
? T extends { auto?: any }
? T['auto']
Expand Down
4 changes: 2 additions & 2 deletions packages/create-rslib/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<picture>
<img alt="Rslib Banner" src="https://assets.rspack.dev/rslib/rslib-banner.png">
<img alt="Rslib Banner" src="https://assets.rspack.rs/rslib/rslib-banner.png">
</picture>

# Rslib

Rslib is a library development tool powered by [Rsbuild](https://rsbuild.dev). It allows library developers to leverage the knowledge and ecosystem of webpack and Rspack.
Rslib is a library development tool powered by [Rsbuild](https://rsbuild.rs). It allows library developers to leverage the knowledge and ecosystem of webpack and Rspack.

## Documentation

Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-dts/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<picture>
<img alt="Rslib Banner" src="https://assets.rspack.dev/rslib/rslib-banner.png">
<img alt="Rslib Banner" src="https://assets.rspack.rs/rslib/rslib-banner.png">
</picture>

# rsbuild-plugin-dts
Expand Down Expand Up @@ -62,7 +62,7 @@ The output directory of declaration files. The default value follows the priorit

1. The `distPath` value of the plugin options.
2. The `declarationDir` value in the `tsconfig.json` file.
3. The [output.distPath.root](https://rsbuild.dev/config/output/dist-path) value of Rsbuild configuration.
3. The [output.distPath.root](https://rsbuild.rs/config/output/dist-path) value of Rsbuild configuration.

```js
pluginDts({
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ Not applicable, Rslib will provide a more simple unencapsulated build boilerplat

Rslib could reuse the plugins from Rsbuild, which means the [official plugins](https://modernjs.dev/en/plugin/plugin-system/introduction.html#official-plugins) provided by Modern Module could be replaced by Rsbuild plugins.

| Plugins | Status | Note |
| -------------------------------------- | ------ | ----------------------------------------------------------------------------- |
| @modern-js/plugin-module-import | 🟢 | Use https://rsbuild.dev/config/source/transform-import#sourcetransformimport. |
| @modern-js/plugin-module-banner | 🟢 | BannerPlugin. |
| @modern-js/plugin-module-node-polyfill | 🟢 | Use https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill. |
| @modern-js/plugin-module-polyfill | ⚪️ | Use https://rsbuild.dev/config/output/polyfill#outputpolyfill. |
| @modern-js/plugin-module-babel | 🟢 | Use https://rsbuild.dev/plugins/list/plugin-babel. |
| @modern-js/plugin-module-vue | ⚪️ | Use https://rsbuild.dev/plugins/list/plugin-vue. |
| Plugins | Status | Note |
| -------------------------------------- | ------ | ---------------------------------------------------------------------------- |
| @modern-js/plugin-module-import | 🟢 | Use https://rsbuild.rs/config/source/transform-import#sourcetransformimport. |
| @modern-js/plugin-module-banner | 🟢 | BannerPlugin. |
| @modern-js/plugin-module-node-polyfill | 🟢 | Use https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill. |
| @modern-js/plugin-module-polyfill | ⚪️ | Use https://rsbuild.rs/config/output/polyfill#outputpolyfill. |
| @modern-js/plugin-module-babel | 🟢 | Use https://rsbuild.rs/plugins/list/plugin-babel. |
| @modern-js/plugin-module-vue | ⚪️ | Use https://rsbuild.rs/plugins/list/plugin-vue. |

##
4 changes: 2 additions & 2 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rslib website

This website is built with [Rspress](https://github.com/web-infra-dev/rspress), the document content can be written using markdown or mdx syntax. You can refer to the [Rspress Website](https://rspress.dev/) for detailed usage.
This website is built with [Rspress](https://github.com/web-infra-dev/rspress), the document content can be written using markdown or mdx syntax. You can refer to the [Rspress Website](https://rspress.rs/) for detailed usage.

## Contributing

Expand All @@ -14,4 +14,4 @@ The same as Rspack: [Writing style guide](https://github.com/web-infra-dev/rspac

For images you use in the document, it's better to upload them to the [rspack-contrib/rstack-design-resources](https://github.com/rspack-contrib/rstack-design-resources) repository, so the size of the current repository doesn't get too big.

After you upload the images there, they will be automatically deployed under the <https://assets.rspack.dev/>.
After you upload the images there, they will be automatically deployed under the <https://assets.rspack.rs/>.
2 changes: 1 addition & 1 deletion website/docs/en/blog/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Check here for the latest articles and release announcements about Rslib.

> May 14, 2025

We are excited to introduce Rslib — **a library development tool based on Rspack**. Developed by ByteDance Web Infra Team, Rslib helps developers create JavaScript libraries and UI component libraries in a simple and intuitive way while enjoying the ultimate development experience brought by [Rspack](https://rspack.dev/) and [Rsbuild](https://rsbuild.dev/).
We are excited to introduce Rslib — **a library development tool based on Rspack**. Developed by ByteDance Web Infra Team, Rslib helps developers create JavaScript libraries and UI component libraries in a simple and intuitive way while enjoying the ultimate development experience brought by [Rspack](https://rspack.rs/) and [Rsbuild](https://rsbuild.rs/).
26 changes: 13 additions & 13 deletions website/docs/en/blog/introducing-rslib.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { ImageAlt } from '../../../theme/components/ImageAlt';

# Rslib: Build library with Rspack

![banner](https://assets.rspack.dev/rslib/rslib-banner.png)
![banner](https://assets.rspack.rs/rslib/rslib-banner.png)

We are excited to introduce Rslib — **a library development tool based on Rspack**. Developed by ByteDance Web Infra Team, Rslib helps developers create JavaScript libraries and UI component libraries in a simple and intuitive way while enjoying the ultimate development experience brought by [Rspack](https://rspack.dev/) and [Rsbuild](https://rsbuild.dev/).
We are excited to introduce Rslib — **a library development tool based on Rspack**. Developed by ByteDance Web Infra Team, Rslib helps developers create JavaScript libraries and UI component libraries in a simple and intuitive way while enjoying the ultimate development experience brought by [Rspack](https://rspack.rs/) and [Rsbuild](https://rsbuild.rs/).

> Repo:https://github.com/web-infra-dev/rslib

Expand All @@ -35,12 +35,12 @@ Facing these pain points, we hope the ideal library development tool would:
- **Shared Ecosystem:** Unify library building with application building configurations, reuse Rspack's prosperous community, and promote unified toolchain ecosystem development.
- **Performance First:** The underlying bundler is implemented in Rust, offering excellent build performance and improving developer experience.

Therefore, we created Rslib. **Based on the well-designed configurations and plugins of [Rsbuild](https://rsbuild.dev)'s, it empowers library developers to take advantage of the extensive knowledge and ecosystem of webpack and Rspack, providing comprehensive library development features.**
Therefore, we created Rslib. **Based on the well-designed configurations and plugins of [Rsbuild](https://rsbuild.rs)'s, it empowers library developers to take advantage of the extensive knowledge and ecosystem of webpack and Rspack, providing comprehensive library development features.**

We hope Rslib can provide more powerful features for library developers and become an important part of the Rspack ecosystem, continuously promoting the development of unified toolchains based on Rspack.

<img
src="https://assets.rspack.dev/others/assets/rslib/rslib-in-rstack.png"
src="https://assets.rspack.rs/others/assets/rslib/rslib-in-rstack.png"
alt="Rslib in Rstack ecosystem"
width="760"
style={{ display: 'block', margin: '0 auto' }}
Expand All @@ -65,7 +65,7 @@ Rslib provides a comprehensive library building solution that covers most curren
For TypeScript declaration files (d.ts), besides supporting d.ts file generation and related post-processing based on TypeScript Compiler API, it also supports bundling d.ts files using [@microsoft/api-extractor](https://www.npmjs.com/package/@microsoft/api-extractor), suitable for handling complex dependency scenarios.

<img
src="https://assets.rspack.dev/others/assets/rslib/multiple-formats-config.png"
src="https://assets.rspack.rs/others/assets/rslib/multiple-formats-config.png"
alt="Multiple formats in one configuration file"
width="400"
style={{ display: 'block', margin: '0 auto' }}
Expand All @@ -74,7 +74,7 @@ Rslib provides a comprehensive library building solution that covers most curren
<ImageAlt>Multiple formats in one configuration file</ImageAlt>

<img
src="https://assets.rspack.dev/others/assets/rslib/simple-esm-output.png"
src="https://assets.rspack.rs/others/assets/rslib/simple-esm-output.png"
alt="Clean ESM output"
width="400"
style={{ display: 'block', margin: '0 auto' }}
Expand All @@ -87,7 +87,7 @@ Rslib provides a comprehensive library building solution that covers most curren
Rslib supports both bundle and bundleless build modes during build process. For bundleless scenarios, it also supports [output path redirection](/config/lib/redirect) feature, solving common issues with alias replacement in JavaScript and d.ts output paths, as well as strict path reference requirements in ESM.

<img
src="https://assets.rspack.dev/rslib/rslib-bundleless-mode.png"
src="https://assets.rspack.rs/rslib/rslib-bundleless-mode.png"
alt="bundleless output structure"
width="760"
style={{ display: 'block', margin: '0 auto' }}
Expand All @@ -102,7 +102,7 @@ Rslib provides a comprehensive library building solution that covers most curren
Leveraging Rsbuild's plugin system and ecosystem, Rslib can directly reuse solutions for Sass, Less, Stylus, CSS Modules, and Tailwind CSS. Whether in bundle or bundleless scenarios, users can process styles just like building web application, directly through configuration or installing corresponding plugins.

<img
src="https://assets.rspack.dev/others/assets/rslib/multiple-styles-config.png"
src="https://assets.rspack.rs/others/assets/rslib/multiple-styles-config.png"
alt="Support multiple style solutions"
width="760"
style={{ display: 'block', margin: '0 auto' }}
Expand All @@ -128,28 +128,28 @@ Beyond common JavaScript library development solutions, based on Rspack and the

- **Leverage Rsbuild Features**

Rslib can reuse most of Rsbuild's configurations, supporting advanced features including but not limited to: [import path transformation](https://rsbuild.dev/config/source/transform-import), [inline styles](https://rsbuild.dev/config/output/inline-styles), [polyfill](https://rsbuild.dev/config/output/polyfill), and will continue to benefit from more features provided by Rsbuild's iterations in the future.
Rslib can reuse most of Rsbuild's configurations, supporting advanced features including but not limited to: [import path transformation](https://rsbuild.rs/config/source/transform-import), [inline styles](https://rsbuild.rs/config/output/inline-styles), [polyfill](https://rsbuild.rs/config/output/polyfill), and will continue to benefit from more features provided by Rsbuild's iterations in the future.

- **Share Rspack and Rsbuild Ecosystem**

Based on the Rspack and Rsbuild ecosystem, Rslib can reuse a series of ecosystem features, including but not limited to:

- Use [Storybook](https://storybook.rsbuild.dev/guide/integrations/rslib.html) to directly read Rslib's configuration files for UI component library development debugging.
- Use [Rsdoctor](https://rsdoctor.dev/) for build performance and output analysis.
- Use [Storybook](https://storybook.rsbuild.rs/guide/integrations/rslib.html) to directly read Rslib's configuration files for UI component library development debugging.
- Use [Rsdoctor](https://rsdoctor.rs/) for build performance and output analysis.
- Use [Node.js polyfill](https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill) plugin to develop cross-runtime libraries.
- Use [ESLint plugin](https://github.com/rspack-contrib/rsbuild-plugin-eslint) for ESLint validation during development.
- Use [publint plugin](https://github.com/rspack-contrib/rsbuild-plugin-publint) to check if the library's package.json is configured correctly.

<img
src="https://assets.rspack.dev/others/assets/rslib/publint-screenshot.png"
src="https://assets.rspack.rs/others/assets/rslib/publint-screenshot.png"
alt="Use publint to check package.json"
width="760"
style={{ display: 'block', margin: '0 auto' }}
/>

<ImageAlt>Use publint to check package.json</ImageAlt>

> For more plugin information, please refer to [Rsbuild Plugin Overview](https://rsbuild.dev/plugins/list/).
> For more plugin information, please refer to [Rsbuild Plugin Overview](https://rsbuild.rs/plugins/list/).

## Current status and version evolution

Expand Down
2 changes: 1 addition & 1 deletion website/docs/en/config/lib/auto-extension.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ When `autoExtension` is set to `false`, the file extension will be default to `.

## Customize extension

You can set `autoExtension` to `false` and use [output.filename](https://rsbuild.dev/config/output/filename) to customize the JavaScript output files.
You can set `autoExtension` to `false` and use [output.filename](https://rsbuild.rs/config/output/filename) to customize the JavaScript output files.

```ts title="rslib.config.ts"
export default defineConfig({
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en/config/lib/banner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ Inject content into the top of each declaration output file.

## Notice

The banner content in JavaScript and CSS file is based on the [BannerPlugin](https://rspack.dev/plugins/webpack/banner-plugin) of Rspack. You should notice the following points:
The banner content in JavaScript and CSS file is based on the [BannerPlugin](https://rspack.rs/plugins/webpack/banner-plugin) of Rspack. You should notice the following points:

- `raw: true` is enabled by default, so the banner content will be injected as a raw string instead of wrapping in a comment. So if you want to inject a comment, you should add `/*` and `*/` or other comment syntax by yourself.
- The `stage` option is set to the stage after the JavaScript and CSS files are optimized, thus preventing the banner content from being optimized away.

## Customize banner content

If the above default settings cannot meet your requirements, you can customize the banner content through `tools.rspack.plugins` to add a [BannerPlugin](https://rspack.dev/plugins/webpack/banner-plugin) instance with the corresponding options.
If the above default settings cannot meet your requirements, you can customize the banner content through `tools.rspack.plugins` to add a [BannerPlugin](https://rspack.rs/plugins/webpack/banner-plugin) instance with the corresponding options.

```ts title="rslib.config.ts"
export default {
Expand Down
Loading
Loading