From 55b70e21839b8fdd65dd6c79d0918cd682b12734 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Oct 2025 02:48:22 +0000 Subject: [PATCH 1/6] Initial plan From 03f19911ab0434133f96ea843852dea9ddc7e098 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Oct 2025 02:54:31 +0000 Subject: [PATCH 2/6] docs: improve English clarity in documentation files Co-authored-by: chenjiahan <7237365+chenjiahan@users.noreply.github.com> --- website/docs/en/guide/advanced/env-vars.mdx | 6 +++--- website/docs/en/guide/advanced/hmr.mdx | 4 ++-- website/docs/en/guide/basic/html-template.mdx | 4 ++-- website/docs/en/guide/basic/server.mdx | 4 ++-- website/docs/en/guide/basic/static-assets.mdx | 4 ++-- website/docs/en/guide/faq/general.mdx | 4 ++-- .../docs/en/guide/optimization/build-performance.mdx | 10 +++++----- website/docs/en/guide/start/index.mdx | 6 +++--- website/docs/en/guide/start/quick-start.mdx | 10 +++++----- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/website/docs/en/guide/advanced/env-vars.mdx b/website/docs/en/guide/advanced/env-vars.mdx index 82a6563535..4fb51f5a1f 100644 --- a/website/docs/en/guide/advanced/env-vars.mdx +++ b/website/docs/en/guide/advanced/env-vars.mdx @@ -1,12 +1,12 @@ # Environment variables -Rsbuild supports injecting environment variables or expressions into your code during the build. This helps distinguish between different running environments or replace constants. +Rsbuild supports injecting environment variables or expressions into your code during compilation. This helps you distinguish between different environments or replace constants. This chapter explains how to use environment variables in Rsbuild. ## Default variables -By default, Rsbuild uses [source.define](#using-define) to inject environment variables into your code, replacing them with their specified values during the build: +By default, Rsbuild uses [source.define](#using-define) to inject environment variables into your code, replacing them with their values during compilation: `import.meta.env` contains these environment variables: @@ -51,7 +51,7 @@ if (false) { } ``` -During code minification, `if (false) { ... }` will be recognized as invalid code and removed automatically. +During code minification, `if (false) { ... }` will be recognized as dead code and automatically removed. ### import.meta.env.DEV diff --git a/website/docs/en/guide/advanced/hmr.mdx b/website/docs/en/guide/advanced/hmr.mdx index 225df558e9..019983cec7 100644 --- a/website/docs/en/guide/advanced/hmr.mdx +++ b/website/docs/en/guide/advanced/hmr.mdx @@ -10,7 +10,7 @@ Hot Module Replacement (HMR) exchanges, adds, or removes modules while an applic Rsbuild has built-in support for HMR, which is enabled by default in development mode. -If you don't need HMR, set [dev.hmr](/config/dev/hmr) to `false`. This will disable HMR and react-refresh, and Rsbuild will automatically fall back to [dev.liveReload](/config/dev/live-reload). +If you don't need HMR, set [dev.hmr](/config/dev/hmr) to `false`. This will disable HMR and React Refresh, and Rsbuild will automatically fall back to [dev.liveReload](/config/dev/live-reload). ```ts title="rsbuild.config.ts" export default { @@ -20,7 +20,7 @@ export default { }; ``` -To disable both HMR and liveReload, set both [dev.hmr](/config/dev/hmr) and [dev.liveReload](/config/dev/live-reload) to `false`. Then, no WebSocket requests will be made to the dev server on the page, and the page will not automatically refresh when files change. +To disable both HMR and live reload, set both [dev.hmr](/config/dev/hmr) and [dev.liveReload](/config/dev/live-reload) to `false`. Then, no WebSocket requests will be made to the dev server from the page, and the page will not automatically refresh when files change. ```ts title="rsbuild.config.ts" export default { diff --git a/website/docs/en/guide/basic/html-template.mdx b/website/docs/en/guide/basic/html-template.mdx index ea1e63dc2a..fc963cf08d 100644 --- a/website/docs/en/guide/basic/html-template.mdx +++ b/website/docs/en/guide/basic/html-template.mdx @@ -61,7 +61,7 @@ export default { }; ``` -When your project has multiple pages, you can set corresponding titles for different pages based on the entry name. +When your project has multiple pages, you can set different titles for each page based on the entry name. ```ts export default { @@ -142,7 +142,7 @@ The generated meta tag in HTML is: ## Default template engine -Rsbuild comes with a built-in default template engine to handle HTML template files, and its syntax is similar to a subset of EJS, but it has some differences. When the suffix of an HTML template file is `.html`, Rsbuild will use the built-in template engine to parse the HTML template. +Rsbuild has a built-in default template engine for handling HTML template files. Its syntax is similar to a subset of EJS, with some differences. When an HTML template file has a `.html` extension, Rsbuild will use the built-in template engine to parse it. For example, if a `text` param is defined in the template with the value `'world'`, Rsbuild will automatically replace `<%= text %>` with the specified value during the build process. diff --git a/website/docs/en/guide/basic/server.mdx b/website/docs/en/guide/basic/server.mdx index b73bed51fd..f8ef1f2200 100644 --- a/website/docs/en/guide/basic/server.mdx +++ b/website/docs/en/guide/basic/server.mdx @@ -38,7 +38,7 @@ The Rsbuild server generates page routes based on the [server.base](/config/serv When the entry is `index`, the page can be accessed at `/`. When the entry is `foo`, the page can be accessed at `/foo`. -When `server.base` is `/base`, the index page can be accessed at `/base` and the foo page at `/base/foo`. +When `server.base` is `/base`, the index page can be accessed at `/base`, and the foo page can be accessed at `/base/foo`. ```ts title="rsbuild.config.ts" export default { @@ -112,7 +112,7 @@ export default { ## Rspack dev server -Rsbuild has a built-in lightweight dev server that differs from the dev servers in Rspack CLI or webpack CLI. There are several differences between them, including different configuration options. +Rsbuild has a built-in lightweight dev server that differs from the dev servers provided by Rspack CLI or webpack CLI. There are several differences between them, including different configuration options. ### Comparison diff --git a/website/docs/en/guide/basic/static-assets.mdx b/website/docs/en/guide/basic/static-assets.mdx index 6977e187b8..e2c2d494f1 100644 --- a/website/docs/en/guide/basic/static-assets.mdx +++ b/website/docs/en/guide/basic/static-assets.mdx @@ -92,7 +92,7 @@ Importing with [alias](/guide/advanced/alias) is also supported: } ``` -If you want to reference static assets with absolute paths in CSS files: +If you want to reference static assets using absolute paths in CSS files: ```css @font-face { @@ -101,7 +101,7 @@ If you want to reference static assets with absolute paths in CSS files: } ``` -By default, Rsbuild's built-in `css-loader` will resolve absolute paths in `url()` and look for the specified modules. If you want to skip resolving absolute paths, you can configure [`tools.cssLoader`](/config/tools/css-loader#toolscssloader) to filter out specific paths. Filtered paths will remain unchanged in the code. +By default, Rsbuild's built-in `css-loader` will resolve absolute paths in `url()` and look for the specified modules. If you want to skip resolving absolute paths, you can configure [`tools.cssLoader`](/config/tools/css-loader#toolscssloader) to filter out specific paths. Filtered paths will be left unchanged in the code. ```ts export default { diff --git a/website/docs/en/guide/faq/general.mdx b/website/docs/en/guide/faq/general.mdx index 7c67340698..b2321eff8a 100644 --- a/website/docs/en/guide/faq/general.mdx +++ b/website/docs/en/guide/faq/general.mdx @@ -16,7 +16,7 @@ The main differences between Rspack and Rsbuild are: Rsbuild is designed for building web applications out of the box. -For libraries and UI components, we recommend using [Rslib](https://github.com/web-infra-dev/rslib), which is a library development tool based on Rsbuild and can reuse Rsbuild's configuration and plugins. +For libraries and UI components, we recommend using [Rslib](https://github.com/web-infra-dev/rslib), a library development tool based on Rsbuild that can reuse Rsbuild's configuration and plugins. --- @@ -28,4 +28,4 @@ The main differences between Modern.js and Rsbuild are: - Modern.js is based on React, while Rsbuild is not coupled with any frontend UI framework. - Modern.js is a full-stack solution, providing runtime and server-side capabilities, while Rsbuild is a build tool with other capabilities extendable via plugins. -- Modern.js has more built-in features, while Rsbuild pursues lightweight and flexibility. +- Modern.js has more built-in features, while Rsbuild focuses on being lightweight and flexible. diff --git a/website/docs/en/guide/optimization/build-performance.mdx b/website/docs/en/guide/optimization/build-performance.mdx index b3965aaa1f..92a462482a 100644 --- a/website/docs/en/guide/optimization/build-performance.mdx +++ b/website/docs/en/guide/optimization/build-performance.mdx @@ -1,8 +1,8 @@ # Improve build performance -Rsbuild optimizes build performance by default, but you may encounter performance issues as your project grows larger. +Rsbuild optimizes build performance by default, but you may encounter performance issues as your project grows. -This document provides optional optimization methods to improve build performance. +This document provides optional optimization strategies to improve build performance. ## Performance profiling @@ -16,15 +16,15 @@ These general optimization methods can speed up both development and production ### Upgrade Rsbuild -Upgrading to the latest version of Rsbuild provides the latest performance optimizations. See [Upgrade Rsbuild](/guide/basic/upgrade-rsbuild) for more details. +Upgrading to the latest version of Rsbuild gives you access to the latest performance optimizations. See [Upgrade Rsbuild](/guide/basic/upgrade-rsbuild) for more details. ### Enable persistent cache -Rsbuild provides [performance.buildCache](/config/performance/build-cache) configuration to significantly improve rebuild speed. +Rsbuild provides a [performance.buildCache](/config/performance/build-cache) configuration that can significantly improve rebuild speed. ### Reduce module count -Optimizing the number of modules referenced by the application reduces bundle size and improves build performance. Read the [Bundle Size Optimization](/guide/optimization/optimize-bundle) section to learn optimization methods. +Optimizing the number of modules your application uses reduces bundle size and improves build performance. Read the [Bundle Size Optimization](/guide/optimization/optimize-bundle) section to learn optimization strategies. ### Optimize Tailwind CSS diff --git a/website/docs/en/guide/start/index.mdx b/website/docs/en/guide/start/index.mdx index 0704af0184..aa47f94ef5 100644 --- a/website/docs/en/guide/start/index.mdx +++ b/website/docs/en/guide/start/index.mdx @@ -1,6 +1,6 @@ # Introduction -Rsbuild is a high-performance build tool powered by Rspack. It provides thoughtfully designed default build configurations for an out-of-the-box development experience that fully unleashes Rspack's performance advantages. +Rsbuild is a high-performance build tool powered by Rspack. It provides carefully designed default build configurations that deliver an out-of-the-box development experience while fully leveraging Rspack's performance advantages. Rsbuild provides [rich build features](/guide/start/features), including compilation of TypeScript, JSX, Sass, Less, CSS Modules, Wasm, and more. It also supports Module Federation, image compression, type checking, PostCSS, Lightning CSS, and additional features. @@ -26,7 +26,7 @@ Rsbuild is a build tool on par with [Vite](https://vitejs.dev/), [Create React A You can think of Rsbuild as a modernized version of Create React App or Vue CLI, with these key differences: -- The underlying bundler switched from webpack to Rspack, delivering 5 to 10 times better build performance. +- The underlying bundler has switched from webpack to Rspack, delivering 5 to 10 times better build performance. - It's decoupled from frontend UI frameworks and supports all UI frameworks via [plugins](/plugins/list/index), including React, Vue, Svelte, Solid, and more. - It provides better extensibility. You can extend Rsbuild flexibly through [Configurations](/config/index), [Plugin API](/plugins/dev/index), and [JavaScript API](/api/start/index). @@ -48,7 +48,7 @@ Rsbuild has the following features: - **Plugin Ecosystem**: Rsbuild has a lightweight plugin system and includes a range of high-quality official plugins. Furthermore, Rsbuild is compatible with most webpack plugins and all Rspack plugins, allowing users to leverage existing community or in-house plugins in Rsbuild without rewriting code. -- **Stable Artifacts**: Rsbuild focuses strongly on build artifact stability. It ensures high consistency between artifacts in development and production builds, and automatically handles syntax downgrading and polyfill injection. Rsbuild also provides plugins for type checking and artifact syntax validation to prevent quality and compatibility issues in production code. +- **Stable Artifacts**: Rsbuild places a strong focus on build artifact stability. It ensures high consistency between artifacts in development and production builds, and automatically handles syntax downgrading and polyfill injection. Rsbuild also provides plugins for type checking and artifact syntax validation to prevent quality and compatibility issues in production code. - **Framework Agnostic**: Rsbuild is not coupled to any frontend UI framework. It supports frameworks like React, Vue, Svelte, Solid, and Preact through plugins, with plans to support more UI frameworks from the community in the future. diff --git a/website/docs/en/guide/start/quick-start.mdx b/website/docs/en/guide/start/quick-start.mdx index ac3c61f3a3..1646fbbc2a 100644 --- a/website/docs/en/guide/start/quick-start.mdx +++ b/website/docs/en/guide/start/quick-start.mdx @@ -2,7 +2,7 @@ ## Online examples -We provide online examples based on Rsbuild. These examples give you an intuitive feel for the build performance of Rspack and the development experience of Rsbuild: +We provide online examples based on Rsbuild. These examples give you an intuitive sense of Rspack's build performance and Rsbuild's development experience: - [StackBlitz example](https://stackblitz.com/~/github.com/rspack-contrib/rsbuild-stackblitz-example) - [CodeSandbox example](https://codesandbox.io/p/github/rspack-contrib/rsbuild-codesandbox-example) @@ -39,13 +39,13 @@ import { PackageManagerTabs } from '@theme'; }} /> -Follow the prompts step by step. During setup, choose whether you need additional tools like TypeScript, ESLint, etc. +Follow the prompts step by step. During setup, you can choose whether to add optional tools like TypeScript, ESLint, etc. After creating the application, run these commands: - Run `git init` to initialize the Git repository. - Run `npm install` (or the install command of your package manager) to install npm dependencies. -- Run `npm run dev` to start the development server, which runs on `localhost:5173` by default. +- Run `npm run dev` to start the development server, which runs on `http://localhost:5173` by default. ### Templates @@ -70,7 +70,7 @@ When creating an application, you can choose from the following templates provid ### Optional tools -`create-rsbuild` can help you set up commonly used tools, including [Biome](https://github.com/biomejs/biome), [ESLint](https://github.com/eslint/eslint), and [prettier](https://github.com/prettier/prettier). Use the arrow keys and space bar to make selections. If you don't need these tools, simply press Enter to skip. +`create-rsbuild` can help you set up commonly used tools, including [Biome](https://github.com/biomejs/biome), [ESLint](https://github.com/eslint/eslint), and [Prettier](https://github.com/prettier/prettier). Use the arrow keys and space bar to make your selections. If you don't need these tools, simply press Enter to skip. ``` ◆ Select additional tools (Use to select, to continue) @@ -114,7 +114,7 @@ npx create-rsbuild -d my-app -t react npx create-rsbuild -d my-app -t react --tools eslint --tools prettier ``` -All the CLI flags of `create-rsbuild`: +All CLI flags supported by `create-rsbuild`: ``` Usage: create-rsbuild [options] From 6694b8ba98c5a6203e74013b6ddb3bf6e69caee5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Oct 2025 02:58:59 +0000 Subject: [PATCH 3/6] docs: revert prettier capitalization to match original Co-authored-by: chenjiahan <7237365+chenjiahan@users.noreply.github.com> --- website/docs/en/guide/start/quick-start.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/en/guide/start/quick-start.mdx b/website/docs/en/guide/start/quick-start.mdx index 1646fbbc2a..0627b570d5 100644 --- a/website/docs/en/guide/start/quick-start.mdx +++ b/website/docs/en/guide/start/quick-start.mdx @@ -70,7 +70,7 @@ When creating an application, you can choose from the following templates provid ### Optional tools -`create-rsbuild` can help you set up commonly used tools, including [Biome](https://github.com/biomejs/biome), [ESLint](https://github.com/eslint/eslint), and [Prettier](https://github.com/prettier/prettier). Use the arrow keys and space bar to make your selections. If you don't need these tools, simply press Enter to skip. +`create-rsbuild` can help you set up commonly used tools, including [Biome](https://github.com/biomejs/biome), [ESLint](https://github.com/eslint/eslint), and [prettier](https://github.com/prettier/prettier). Use the arrow keys and space bar to make your selections. If you don't need these tools, simply press Enter to skip. ``` ◆ Select additional tools (Use to select, to continue) From 2b559fb5a1b40132a7e2a96efacd2198bc1f773c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Oct 2025 03:00:28 +0000 Subject: [PATCH 4/6] docs: fix prettier capitalization for consistency Co-authored-by: chenjiahan <7237365+chenjiahan@users.noreply.github.com> --- website/docs/en/guide/start/quick-start.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/en/guide/start/quick-start.mdx b/website/docs/en/guide/start/quick-start.mdx index 0627b570d5..1646fbbc2a 100644 --- a/website/docs/en/guide/start/quick-start.mdx +++ b/website/docs/en/guide/start/quick-start.mdx @@ -70,7 +70,7 @@ When creating an application, you can choose from the following templates provid ### Optional tools -`create-rsbuild` can help you set up commonly used tools, including [Biome](https://github.com/biomejs/biome), [ESLint](https://github.com/eslint/eslint), and [prettier](https://github.com/prettier/prettier). Use the arrow keys and space bar to make your selections. If you don't need these tools, simply press Enter to skip. +`create-rsbuild` can help you set up commonly used tools, including [Biome](https://github.com/biomejs/biome), [ESLint](https://github.com/eslint/eslint), and [Prettier](https://github.com/prettier/prettier). Use the arrow keys and space bar to make your selections. If you don't need these tools, simply press Enter to skip. ``` ◆ Select additional tools (Use to select, to continue) From 3e14b0490fff2e9a27f26b7149c7d93e2558d81f Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 18 Oct 2025 17:49:49 +0800 Subject: [PATCH 5/6] Apply suggestion from @chenjiahan --- website/docs/en/guide/advanced/env-vars.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/en/guide/advanced/env-vars.mdx b/website/docs/en/guide/advanced/env-vars.mdx index 4fb51f5a1f..ff627126b9 100644 --- a/website/docs/en/guide/advanced/env-vars.mdx +++ b/website/docs/en/guide/advanced/env-vars.mdx @@ -1,6 +1,6 @@ # Environment variables -Rsbuild supports injecting environment variables or expressions into your code during compilation. This helps you distinguish between different environments or replace constants. +Rsbuild supports injecting environment variables or expressions into your code during the build. This helps you distinguish between different environments or replace constants. This chapter explains how to use environment variables in Rsbuild. From 86e4b8c8fca43d802d61e5eaad30c0d0ac145a55 Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 18 Oct 2025 17:49:55 +0800 Subject: [PATCH 6/6] Apply suggestion from @chenjiahan --- website/docs/en/guide/advanced/env-vars.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/en/guide/advanced/env-vars.mdx b/website/docs/en/guide/advanced/env-vars.mdx index ff627126b9..ac7db15440 100644 --- a/website/docs/en/guide/advanced/env-vars.mdx +++ b/website/docs/en/guide/advanced/env-vars.mdx @@ -6,7 +6,7 @@ This chapter explains how to use environment variables in Rsbuild. ## Default variables -By default, Rsbuild uses [source.define](#using-define) to inject environment variables into your code, replacing them with their values during compilation: +By default, Rsbuild uses [source.define](#using-define) to inject environment variables into your code, replacing them with their values during during the build: `import.meta.env` contains these environment variables: