diff --git a/e2e/cases/filename-function/index.test.ts b/e2e/cases/filename-function/index.test.ts index 54a223fcfc..b4a99a836f 100644 --- a/e2e/cases/filename-function/index.test.ts +++ b/e2e/cases/filename-function/index.test.ts @@ -20,4 +20,16 @@ test('should allow to custom filename by function', async () => { filename.includes('dist/static/js/async/some-path/foo.js'), ), ).toBeTruthy(); + + // CSS + expect( + filenames.some((filename) => + filename.includes('dist/static/css/my-index.css'), + ), + ).toBeTruthy(); + expect( + filenames.some((filename) => + filename.includes('dist/static/css/async/some-path/foo.css'), + ), + ).toBeTruthy(); }); diff --git a/website/docs/en/config/output/filename.mdx b/website/docs/en/config/output/filename.mdx index dc4f012201..70720ccab3 100644 --- a/website/docs/en/config/output/filename.mdx +++ b/website/docs/en/config/output/filename.mdx @@ -7,8 +7,16 @@ type FilenameConfig = { html?: string; js?: | string - | ((pathData: Rspack.PathData, assetInfo: Rspack.JsAssetInfo) => string); - css?: string; + | (( + pathData: Rspack.PathData, + assetInfo: Rspack.JsAssetInfo | undefined, + ) => string); + css?: + | string + | (( + pathData: Rspack.PathData, + assetInfo: Rspack.JsAssetInfo | undefined, + ) => string); svg?: string; font?: string; image?: string; diff --git a/website/docs/zh/config/output/filename.mdx b/website/docs/zh/config/output/filename.mdx index d0d99f18fa..3f230dd0a2 100644 --- a/website/docs/zh/config/output/filename.mdx +++ b/website/docs/zh/config/output/filename.mdx @@ -7,10 +7,16 @@ type FilenameConfig = { html?: string; js?: | string - | ((pathData: Rspack.PathData, assetInfo: Rspack.JsAssetInfo) => string); + | (( + pathData: Rspack.PathData, + assetInfo: Rspack.JsAssetInfo | undefined, + ) => string); css?: | string - | ((pathData: Rspack.PathData, assetInfo: Rspack.JsAssetInfo) => string); + | (( + pathData: Rspack.PathData, + assetInfo: Rspack.JsAssetInfo | undefined, + ) => string); svg?: string; font?: string; image?: string;