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 website/docs/en/guide/advanced/env-vars.mdx
Original file line number Diff line number Diff line change
@@ -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 the build. 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 during the build:
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate word 'during' should be removed.

Suggested change
By default, Rsbuild uses [source.define](#using-define) to inject environment variables into your code, replacing them with their values during during the build:
By default, Rsbuild uses [source.define](#using-define) to inject environment variables into your code, replacing them with their values during the build:

Copilot uses AI. Check for mistakes.

`import.meta.env` contains these environment variables:

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions website/docs/en/guide/advanced/hmr.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en/guide/basic/html-template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions website/docs/en/guide/basic/server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions website/docs/en/guide/basic/static-assets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions website/docs/en/guide/faq/general.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand All @@ -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.
10 changes: 5 additions & 5 deletions website/docs/en/guide/optimization/build-performance.mdx
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions website/docs/en/guide/start/index.mdx
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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).

Expand All @@ -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.

Expand Down
10 changes: 5 additions & 5 deletions website/docs/en/guide/start/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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 <space> to select, <enter> to continue)
Expand Down Expand Up @@ -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]
Expand Down
Loading