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
3 changes: 2 additions & 1 deletion packages/core/src/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export function setupCommands(): void {
// Apply common options to all commands
applyCommonOptions(cli);

const devCommand = cli.command('dev', 'starting the dev server');
// Allow to run `rsbuild` without any sub-command to trigger dev
const devCommand = cli.command('', 'starting the dev server').alias('dev');
const buildCommand = cli.command('build', 'build the app for production');
const previewCommand = cli.command(
'preview',
Expand Down
6 changes: 6 additions & 0 deletions website/docs/en/guide/basic/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Options:
--host <host> specify the host that the Rsbuild server listens to
```

You can also start the dev server by running `rsbuild` directly, which is equivalent to running `rsbuild dev`.

```bash
npx rsbuild
```

### Opening page

The `--open` option allows you to automatically open a page when starting the dev server, which is equivalent to setting [server.open](/config/server/open) to `true`.
Expand Down
6 changes: 6 additions & 0 deletions website/docs/zh/guide/basic/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Options:
--host <host> 指定 Rsbuild server 启动时监听的 host
```

你也可以直接运行 `rsbuild` 来启动 dev server,等同于运行 `rsbuild dev`。

```bash
npx rsbuild
```

### 打开页面

通过 `--open` 选项可以在启动 dev server 时自动打开页面,等同于将 [server.open](/config/server/open) 设置为 `true`。
Expand Down
Loading