Skip to content

Commit

Permalink
docs: update html plugin filename type
Browse files Browse the repository at this point in the history
  • Loading branch information
LingyuCoder committed Oct 28, 2024
1 parent 8447e2c commit 52056c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions website/docs/en/plugins/rspack/html-rspack-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ You can pass some configuration options to `rspack.HtmlRspackPlugin`. Allowed op
```ts
type HtmlRspackPluginOptions = {
title?: string;
filename?: string;
filename?: string | ((entry: string) => string);
template?: string;
templateContent?: string | ((params: Record<string, any>) => string | Promise<string>);
templateParameters?: Record<string, string> | (oldParams: params: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>;
Expand Down Expand Up @@ -189,7 +189,7 @@ type HtmlRspackPluginOptions = {
},
{
name: '`filename`',
type: '`string|undefined`',
type: '`string|undefined|((entry: string) => string)`',
default: "'index.html'",
description:
'The file to write the HTML to. Defaults to `index.html`. You can specify a subdirectory here too (eg: pages/index.html).',
Expand Down
4 changes: 2 additions & 2 deletions website/docs/zh/plugins/rspack/html-rspack-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ module.exports = {
```ts
type HtmlRspackPluginOptions = {
title?: string;
filename?: string;
filename?: string | ((entry: string) => string);
template?: string;
templateContent?: string | ((params: Record<string, any>) => string | Promise<string>);
templateParameters?: Record<string, string> | (oldParams: params: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>;
Expand Down Expand Up @@ -189,7 +189,7 @@ type HtmlRspackPluginOptions = {
},
{
name: '`filename`',
type: '`string|undefined`',
type: '`string|undefined|((entry: string) => string)`',
default: "'index.html'",
description: '输出的文件名,可以指定子目录,例如 `pages/index.html`',
},
Expand Down

0 comments on commit 52056c0

Please sign in to comment.