From 52056c00d248ae17015deeb78dc15d7aa51eb826 Mon Sep 17 00:00:00 2001 From: LingyuCoder Date: Mon, 28 Oct 2024 15:46:59 +0800 Subject: [PATCH] docs: update html plugin filename type --- website/docs/en/plugins/rspack/html-rspack-plugin.mdx | 4 ++-- website/docs/zh/plugins/rspack/html-rspack-plugin.mdx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/en/plugins/rspack/html-rspack-plugin.mdx b/website/docs/en/plugins/rspack/html-rspack-plugin.mdx index d0f9cf489715..e115c75c8eea 100644 --- a/website/docs/en/plugins/rspack/html-rspack-plugin.mdx +++ b/website/docs/en/plugins/rspack/html-rspack-plugin.mdx @@ -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 | Promise); templateParameters?: Record | (oldParams: params: Record) => Record | Promise>; @@ -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).', diff --git a/website/docs/zh/plugins/rspack/html-rspack-plugin.mdx b/website/docs/zh/plugins/rspack/html-rspack-plugin.mdx index c13da557a37a..7dd20f821011 100644 --- a/website/docs/zh/plugins/rspack/html-rspack-plugin.mdx +++ b/website/docs/zh/plugins/rspack/html-rspack-plugin.mdx @@ -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 | Promise); templateParameters?: Record | (oldParams: params: Record) => Record | Promise>; @@ -189,7 +189,7 @@ type HtmlRspackPluginOptions = { }, { name: '`filename`', - type: '`string|undefined`', + type: '`string|undefined|((entry: string) => string)`', default: "'index.html'", description: '输出的文件名,可以指定子目录,例如 `pages/index.html`', },