Skip to content

Commit 8e39520

Browse files
authored
docs(quick-start): update non-interactive mode section (#12083)
* docs(quick-start): update non-interactive mode section * fix * docs * fix
1 parent 702dc01 commit 8e39520

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,21 @@ Run the following command to create an Rspack CLI project:
5555

5656
Then follow the prompts in your terminal.
5757

58-
### Quick creation
58+
### Non-interactive mode
5959

60-
[create-rspack](https://www.npmjs.com/package/create-rspack) and [create-rsbuild](https://www.npmjs.com/package/create-rsbuild) provides some CLI flags. By setting these CLI flags, you can skip the interactive selection steps and create the project with one command.
60+
[create-rspack](https://www.npmjs.com/package/create-rspack) and [create-rsbuild](https://www.npmjs.com/package/create-rsbuild) support a non-interactive mode through command-line options. This mode lets you skip all prompts and create a project directly, which is useful for scripts, CI, and coding agents.
6161

62-
For example, to create a React project in the `my-project` directory with one command:
62+
For example, the following command creates a React app in the `my-app` directory:
6363

6464
```bash
6565
# Rspack CLI
66-
npx create-rspack --dir my-project --template react
66+
npx -y create-rspack --dir my-app --template react
67+
6768
# Rsbuild
68-
npx create-rsbuild --dir my-project --template react
69+
npx -y create-rsbuild --dir my-app --template react
70+
6971
# Using abbreviations
70-
npx create-rsbuild -d my-project -t react
72+
npx -y create-rsbuild -d my-app -t react
7173
```
7274

7375
## Online examples
@@ -100,7 +102,8 @@ Update your build scripts to use Rspack CLI:
100102
{
101103
"scripts": {
102104
"dev": "rspack dev",
103-
"build": "rspack build"
105+
"build": "rspack build",
106+
"preview": "rspack preview"
104107
}
105108
}
106109
```

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@ Rspack CLI 是对标 webpack CLI 的工具,提供基础的 `serve` 和 `build`
5555

5656
然后按照提示操作。
5757

58-
### 快速创建
58+
### 非交互模式
5959

60-
[create-rspack](https://www.npmjs.com/package/create-rspack)[create-rsbuild](https://www.npmjs.com/package/create-rsbuild) 提供了一些 CLI 选项。通过设置这些 CLI 选项,你可以跳过交互式的选择步骤,一键创建项目
60+
[create-rspack](https://www.npmjs.com/package/create-rspack)[create-rsbuild](https://www.npmjs.com/package/create-rsbuild) 支持通过命令行选项进入非交互模式。使用该模式可以跳过所有提示,直接创建项目,适合脚本、CI 以及 coding agents 等自动化场景
6161

62-
比如,一键创建 React 项目到 `my-project` 目录
62+
例如,以下命令将在 `my-app` 目录中创建一个 React 应用
6363

6464
```bash
6565
# Rspack CLI
66-
npx create-rspack --dir my-project --template react
66+
npx -y create-rspack --dir my-app --template react
6767
# Rsbuild
68-
npx create-rsbuild --dir my-project --template react
68+
npx -y create-rsbuild --dir my-app --template react
6969
# 使用缩写
70-
npx create-rsbuild -d my-project -t react
70+
npx -y create-rsbuild -d my-app -t react
7171
```
7272

7373
## 在线示例
@@ -100,7 +100,8 @@ npm init -y
100100
{
101101
"scripts": {
102102
"dev": "rspack dev",
103-
"build": "rspack build"
103+
"build": "rspack build",
104+
"preview": "rspack preview"
104105
}
105106
}
106107
```

0 commit comments

Comments
 (0)