Skip to content

Commit

Permalink
docs: update environment and template parameters (#4100)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Dec 1, 2024
1 parent f27a8cf commit 8b341f2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion website/docs/en/config/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Rsbuild supports building outputs for multiple environments. You can use `enviro

```ts
interface EnvironmentConfig {
plugins?: RsbuildPlugins;
dev?: Pick<
DevConfig,
'hmr' | 'assetPrefix' | 'progressBar' | 'lazyCompilation' | 'writeToDisk'
Expand All @@ -16,10 +17,10 @@ interface EnvironmentConfig {
tools?: ToolsConfig;
source?: SourceConfig;
output?: OutputConfig;
resolve?: ResolveConfig;
security?: SecurityConfig;
performance?: PerformanceConfig;
moduleFederation?: ModuleFederationConfig;
plugins?: RsbuildPlugins[];
}

type Environments = {
Expand Down
6 changes: 3 additions & 3 deletions website/docs/en/config/html/template-parameters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ type DefaultParameters = {
};
```

Define the parameters in the HTML template, corresponding to the `templateParameters` config of [html-rspack-plugin](https://github.com/rspack-contrib/html-rspack-plugin).
Define the parameters in the HTML template, see [HTML Template - Template Parameters](/guide/basic/html-template#template-parameters) for detailed usage.

### Object Usage
## Object Usage

If the value of `templateParameters` is an object, it will be merged with the default parameters using `Object.assign`.

Expand Down Expand Up @@ -60,7 +60,7 @@ The compiled HTML code will be:
</script>
```

### Function Usage
## Function Usage

- **Type:**

Expand Down
3 changes: 2 additions & 1 deletion website/docs/zh/config/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Rsbuild 支持同时为多个环境构建产物。你可以使用 `environments`

```ts
interface EnvironmentConfig {
plugins?: RsbuildPlugins;
dev?: Pick<
DevConfig,
'hmr' | 'assetPrefix' | 'progressBar' | 'lazyCompilation' | 'writeToDisk'
Expand All @@ -16,10 +17,10 @@ interface EnvironmentConfig {
tools?: ToolsConfig;
source?: SourceConfig;
output?: OutputConfig;
resolve?: ResolveConfig;
security?: SecurityConfig;
performance?: PerformanceConfig;
moduleFederation?: ModuleFederationConfig;
plugins?: RsbuildPlugins[];
}

type Environments = {
Expand Down
6 changes: 3 additions & 3 deletions website/docs/zh/config/html/template-parameters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ type DefaultParameters = {
};
```

定义 HTML 模板中的参数,对应 [html-rspack-plugin](https://github.com/rspack-contrib/html-rspack-plugin)`templateParameters` 配置项
定义 HTML 模板中的参数,详细用法请参考 [配置 HTML 模板 - 模板参数](/guide/basic/html-template#模板参数)

### 对象用法
## 对象用法

如果 `templateParameters` 的值是一个对象,它会和默认参数通过 `Object.assign` 合并。

Expand Down Expand Up @@ -60,7 +60,7 @@ export default {
</script>
```

### 函数用法
## 函数用法

- **类型:**

Expand Down

0 comments on commit 8b341f2

Please sign in to comment.