Skip to content

Commit 4b0faee

Browse files
committed
docs: update quick start guide content
1 parent ce031b5 commit 4b0faee

File tree

7 files changed

+67
-25
lines changed

7 files changed

+67
-25
lines changed

website/docs/en/guide/framework/react.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import { PackageManagerTabs } from '@theme';
1717
}}
1818
/>
1919

20-
Then select `React` when prompted to "Select framework".
20+
Then select `React 19` or `React 18` when prompted to "Select framework".
2121

2222
## Use React in an existing project
2323

24-
To compile React, you need to register the Rsbuild [React Plugin](/plugins/list/plugin-react). The plugin will automatically add the necessary configuration for React builds.
24+
To compile React's JSX syntax, you need to register the Rsbuild [React Plugin](/plugins/list/plugin-react). The plugin will automatically add the necessary configuration for building a React application.
2525

2626
For example, register in `rsbuild.config.ts`:
2727

website/docs/en/guide/start/index.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ import Step from '@components/Step';
100100
description="Learn all features of Rsbuild"
101101
/>
102102
<Step
103-
href="/guide/basic/configure-rsbuild"
104-
title="Config"
105-
description="Learn how to configure Rsbuild"
103+
href="https://github.com/web-infra-dev/rsbuild"
104+
title="Support Rsbuild"
105+
description="Support us with a star ⭐️"
106106
/>
107107
</NextSteps>

website/docs/en/guide/start/quick-start.mdx

+27-8
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ import { PackageManagerTabs } from '@theme';
4646
}}
4747
/>
4848

49-
Then follow the prompts to complete the operation.
49+
Follow the prompts step by step. During the creation process, you can choose whether you need additional tools like TypeScript, ESLint, etc.
50+
51+
After the project is created, you can follow these steps:
52+
53+
- Run `git init` to initialize the Git repository.
54+
- Run `npm install` (or the install command of your package manager) to install project dependencies.
55+
- Run `npm run dev` to start the development server, which runs on `localhost:5173` by default.
5056

5157
### Templates
5258

@@ -134,20 +140,22 @@ To migrate from an existing project to Rsbuild, refer to the following guides:
134140
- [Migrate from Vue CLI](/guide/migration/vue-cli)
135141
- [Migrate from Vite](/guide/migration/vite)
136142
- [Migrate from Modern.js Builder](/guide/migration/modern-builder)
143+
- [Migrate from Tsup to Rslib](https://lib.rsbuild.dev/guide/migration/tsup)
144+
- [Migrate from Storybook to Storybook Rsbuild](https://rspack.dev/guide/migration/storybook)
137145

138146
### Other projects
139147

140-
For other types of projects, you can manually install the [@rsbuild/core](https://www.npmjs.com/package/@rsbuild/core) package:
148+
If your project does not belong to the above migration guides, you can manually install the [@rsbuild/core](https://www.npmjs.com/package/@rsbuild/core) package:
141149

142150
<PackageManagerTabs command="add @rsbuild/core -D" />
143151

144-
Then refer to the guide and documentation to enable the features you need:
152+
After installation, you can refer to the following documents to configure your project:
145153

146154
- See [CLI](/guide/basic/cli) to learn about available CLI commands.
147155
- See [Plugin List](/plugins/list/index) to select Rsbuild plugins.
148156
- See [Configure Rsbuild](/guide/basic/configure-rsbuild) to configure Rsbuild.
149157

150-
## Command line interface
158+
## CLI
151159

152160
Rsbuild comes with a lightweight CLI that includes commands such as `dev` and `build`.
153161

@@ -170,6 +178,17 @@ Refer to the [CLI](/guide/basic/cli) to learn about all available commands and o
170178

171179
By default, Rsbuild CLI uses `src/index.(js|ts|jsx|tsx)` as the entry module. You can modify the entry module using the [source.entry](/config/source/entry) option.
172180

181+
```ts title="rsbuild.config.ts"
182+
export default {
183+
source: {
184+
entry: {
185+
foo: './src/pages/foo/index.ts',
186+
bar: './src/pages/bar/index.ts',
187+
},
188+
},
189+
};
190+
```
191+
173192
## Core packages
174193

175194
### @rsbuild/core
@@ -214,7 +233,7 @@ import Step from '@components/Step';
214233
<NextSteps>
215234
<Step
216235
href="/guide/start/features"
217-
title="All Features"
236+
title="All features"
218237
description="Learn all features of Rsbuild"
219238
/>
220239
<Step
@@ -223,8 +242,8 @@ import Step from '@components/Step';
223242
description="Learn how to configure Rsbuild"
224243
/>
225244
<Step
226-
href="/guide/start/glossary"
227-
title="Glossary"
228-
description="Learn about Rsbuild related concepts"
245+
href="https://github.com/web-infra-dev/rsbuild"
246+
title="Support Rsbuild"
247+
description="Support us with a star ⭐️"
229248
/>
230249
</NextSteps>

website/docs/zh/guide/framework/react.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import { PackageManagerTabs } from '@theme';
1717
}}
1818
/>
1919

20-
然后在 `Select framework` 时选择 `React` 即可。
20+
然后在 `Select framework` 时选择 `React 19``React 18` 即可。
2121

2222
## 在已有项目中使用 React
2323

24-
为了能够编译 React,你需要注册 Rsbuild 的 [React 插件](/plugins/list/plugin-react)插件会自动添加 React 构建所需的配置
24+
为了能够编译 React 的 JSX 语法,你需要注册 Rsbuild 的 [React 插件](/plugins/list/plugin-react)插件会自动添加构建一个 React 应用所需的配置
2525

2626
例如,在 `rsbuild.config.ts` 中注册:
2727

website/docs/zh/guide/start/index.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ import Step from '@components/Step';
102102
description="了解 Rsbuild 提供的所有功能"
103103
/>
104104
<Step
105-
href="/guide/basic/configure-rsbuild"
106-
title="查阅配置"
107-
description="了解如何配置 Rsbuild"
105+
href="https://github.com/web-infra-dev/rsbuild"
106+
title="支持 Rsbuild"
107+
description="点个 Star 支持一下✨"
108108
/>
109109
</NextSteps>

website/docs/zh/guide/start/quick-start.mdx

+25-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ import { PackageManagerTabs } from '@theme';
5151
}}
5252
/>
5353

54-
然后按照提示操作即可。
54+
按照提示一步步操作即可。在创建过程中,你可以选择是否需要 TypeScript、ESLint 等额外的工具。
55+
56+
项目创建完成后,你可以执行以下步骤:
57+
58+
- 执行 `git init` 来初始化 Git 仓库。
59+
- 执行 `npm install`(或其他包管理器的 install 命令)安装项目依赖。
60+
- 执行 `npm run dev` 启动开发服务器,服务器默认运行在 `localhost:5173`
5561

5662
### 模板
5763

@@ -139,14 +145,16 @@ Templates:
139145
- [从 Vue CLI 迁移](/guide/migration/vue-cli)
140146
- [从 Vite 迁移](/guide/migration/vite)
141147
- [从 Modern.js Builder 迁移](/guide/migration/modern-builder)
148+
- [从 Tsup 迁移到 Rslib](https://lib.rsbuild.dev/zh/guide/migration/tsup)
149+
- [从 Storybook 迁移到 Storybook Rsbuild](https://rspack.dev/zh/guide/migration/storybook)
142150

143151
### 其他项目
144152

145-
对于其他类型的项目,你可以手动安装 [@rsbuild/core](https://www.npmjs.com/package/@rsbuild/core) 包:
153+
如果你的项目不属于上述迁移指南中提到的类型,你也可以直接安装 [@rsbuild/core](https://www.npmjs.com/package/@rsbuild/core) 包:
146154

147155
<PackageManagerTabs command="add @rsbuild/core -D" />
148156

149-
然后参考指南和文档,按需启用各个功能
157+
完成安装后,你可以参考以下文档来配置你的项目
150158

151159
- 参考 [CLI 工具](/guide/basic/cli) 来了解可用的 CLI 命令。
152160
- 参考 [插件列表](/plugins/list/index) 来选择 Rsbuild 插件。
@@ -175,6 +183,17 @@ Rsbuild 内置了一个轻量的命令行工具,包含 dev、build 等命令
175183

176184
Rsbuild CLI 默认会使用 `src/index.(js|ts|jsx|tsx)` 作为入口模块,你可以使用 [source.entry](/config/source/entry) 配置项来修改入口模块。
177185

186+
```ts title="rsbuild.config.ts"
187+
export default {
188+
source: {
189+
entry: {
190+
foo: './src/pages/foo/index.ts',
191+
bar: './src/pages/bar/index.ts',
192+
},
193+
},
194+
};
195+
```
196+
178197
## 核心 npm 包
179198

180199
### @rsbuild/core
@@ -228,8 +247,8 @@ import Step from '@components/Step';
228247
description="了解如何配置 Rsbuild"
229248
/>
230249
<Step
231-
href="/guide/start/glossary"
232-
title="名词解释"
233-
description="了解 Rsbuild 相关的概念"
250+
href="https://github.com/web-infra-dev/rsbuild"
251+
title="支持 Rsbuild"
252+
description="点个 Star 支持一下✨"
234253
/>
235254
</NextSteps>

website/theme/components/Step.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ import styles from './Step.module.scss';
33
import { useUrl } from './utils';
44

55
const Step = (props: { href: string; title: string; description: string }) => {
6+
const isExternal = props.href.startsWith('http');
67
return (
7-
<Link className={styles.step} href={useUrl(props.href)}>
8+
<Link
9+
className={styles.step}
10+
href={isExternal ? props.href : useUrl(props.href)}
11+
>
812
<p className={styles.title}>{props.title}</p>
913
<p className={styles.description}>{props.description}</p>
1014
</Link>

0 commit comments

Comments
 (0)