Skip to content

Commit

Permalink
docs: server open priority (#3459)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Sep 12, 2024
1 parent 59e67c9 commit ad18cae
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion website/docs/en/config/dev/lazy-compilation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type LazyCompilationOptions =
```

- **Default:** `false`
- **Version:** `>= 0.7.1`

Used to enable lazy compilation (compilation on demand), implemented based on Rspack's [experiments.lazyCompilation](https://rspack.dev/zh/config/experiments#experimentslazycompilation).

Expand Down
1 change: 0 additions & 1 deletion website/docs/en/config/security/sri.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type SriOptions = {
```

- **Default:** `undefined`
- **Version:** `>= 0.7.3`

Adding an `integrity` attribute to `<script>` and `<link rel="stylesheet">` tags introduced by HTML allows the browser to verify the integrity of the introduced resource, thus preventing tampering with the downloaded resource.

Expand Down
5 changes: 2 additions & 3 deletions website/docs/en/config/server/open.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ type Open =
```

- **Default:** `undefined`
- **Version:** `>= 0.7.4`

`server.open` is used to configure a set of page URLs that Rsbuild will automatically open in the browser after starting the server.

> You can also use the [--open](/guide/basic/cli#opening-page) option of Rsbuild CLI to open the pages.
> You can also use the [--open](/guide/basic/cli#opening-page) option of Rsbuild CLI to open the pages. When using `server.open` and `--open` at the same time, `--open` takes precedence.
### Example

Expand Down Expand Up @@ -113,7 +112,7 @@ BROWSER="Google Chrome Canary" npx rsbuild dev --open
```

:::tip
You can set `BROWSER` in the local `.env.local` file, which helps avoid impacting other developers.
You can set `BROWSER` in the local [.env.local](/guide/advanced/env-vars#env-file) file, which helps avoid impacting other developers.
:::

### Callback
Expand Down
4 changes: 4 additions & 0 deletions website/docs/en/guide/basic/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ The `--open` option can also be abbreviated to `-o`:
rsbuild dev -o
```

:::tip
When using [server.open](/config/server/open) and `--open` at the same time, `--open` takes precedence.
:::

## rsbuild build

The `rsbuild build` command will build the outputs for production in the `dist/` directory by default.
Expand Down
1 change: 0 additions & 1 deletion website/docs/zh/config/security/sri.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type SriOptions = {
```

- **默认值:** `undefined`
- **版本:** `>= 0.7.3`

为 HTML 所引入的 `<script>``<link rel="stylesheet">` 标签添加完整性属性 —— `integrity`,使浏览器能够验证引入资源的完整性,以此防止下载的资源被篡改。

Expand Down
5 changes: 2 additions & 3 deletions website/docs/zh/config/server/open.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ type Open =
```

- **默认值:** `undefined`
- **版本:** `>= 0.7.4`

`server.open` 用于配置一组页面 URL,Rsbuild 会在启动 server 后自动在浏览器中打开这些页面。

> 你也可以使用 Rsbuild CLI 的 [--open](/guide/basic/cli#打开页面) 选项来打开页面。
> 你也可以使用 Rsbuild CLI 的 [--open](/guide/basic/cli#打开页面) 选项来打开页面。当同时使用 `server.open``--open` 时,`--open` 的优先级更高。
### 示例

Expand Down Expand Up @@ -113,7 +112,7 @@ BROWSER="Google Chrome Canary" npx rsbuild dev --open
```

:::tip
你可以将 `BROWSER` 设置在本地的 `.env.local` 文件中,这样能够避免影响其他开发者。
你可以将 `BROWSER` 设置在本地的 [.env.local](/guide/advanced/env-vars#env-file) 文件中,这样能够避免影响其他开发者。
:::

### 回调函数
Expand Down
4 changes: 4 additions & 0 deletions website/docs/zh/guide/basic/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ rsbuild dev --open http://localhost:3000/foo
rsbuild dev -o
```

:::tip
当同时使用 [server.open](/config/server/open)`--open` 时,`--open` 的优先级更高。
:::

## rsbuild build

`rsbuild build` 命令默认会在 `dist/` 目录下构建出可用于生产环境的产物。
Expand Down

0 comments on commit ad18cae

Please sign in to comment.