From 78dea8bb88c31042597c8e64a1ea26cc4348d28a Mon Sep 17 00:00:00 2001 From: babu-ch Date: Tue, 25 Mar 2025 19:18:28 +0900 Subject: [PATCH 1/4] feat(rspeedy): Support `performance.printFileSize` --- .changeset/thick-poets-count.md | 7 + packages/rspeedy/core/etc/rspeedy.api.md | 16 +++ .../core/src/config/performance/index.ts | 22 +++ .../src/config/performance/print-file-size.ts | 134 ++++++++++++++++++ .../rspeedy/core/src/config/rsbuild/index.ts | 2 + packages/rspeedy/core/src/index.ts | 4 + .../core/test/config/performance.test-d.ts | 40 ++++++ .../rspeedy/core/test/config/rsbuild.test.ts | 31 ++++ .../rspeedy/core/test/config/validate.test.ts | 94 ++++++++++++ website/rspress.config.ts | 2 + 10 files changed, 352 insertions(+) create mode 100644 .changeset/thick-poets-count.md create mode 100644 packages/rspeedy/core/src/config/performance/print-file-size.ts diff --git a/.changeset/thick-poets-count.md b/.changeset/thick-poets-count.md new file mode 100644 index 0000000000..da782a411f --- /dev/null +++ b/.changeset/thick-poets-count.md @@ -0,0 +1,7 @@ +--- +"@lynx-js/rspeedy": patch +--- + +Support `performance.printFileSize` + +Whether to print the file sizes after production build. diff --git a/packages/rspeedy/core/etc/rspeedy.api.md b/packages/rspeedy/core/etc/rspeedy.api.md index fbecbd08c2..30c3518d44 100644 --- a/packages/rspeedy/core/etc/rspeedy.api.md +++ b/packages/rspeedy/core/etc/rspeedy.api.md @@ -232,9 +232,25 @@ export interface Output { // @public export interface Performance { chunkSplit?: ChunkSplit | ChunkSplitBySize | ChunkSplitCustom | undefined; + printFileSize?: boolean | PrintFileSize | undefined; removeConsole?: boolean | ConsoleType[] | undefined; } +// @public +export interface PrintFileSize { + compressed?: boolean; + detail?: boolean; + exclude?: ((asset: PrintFileSizeAsset) => boolean) | undefined; + include?: ((asset: PrintFileSizeAsset) => boolean) | undefined; + total?: boolean; +} + +// @public (undocumented) +export interface PrintFileSizeAsset { + name: string; + size: number; +} + export { RsbuildPlugin } export { RsbuildPluginAPI } diff --git a/packages/rspeedy/core/src/config/performance/index.ts b/packages/rspeedy/core/src/config/performance/index.ts index 94370b2c36..2d52a0cbb5 100644 --- a/packages/rspeedy/core/src/config/performance/index.ts +++ b/packages/rspeedy/core/src/config/performance/index.ts @@ -6,6 +6,7 @@ import type { ChunkSplitBySize, ChunkSplitCustom, } from './chunk-split.js' +import type { PrintFileSize } from './print-file-size.js' /** * The type of the console method. @@ -67,4 +68,25 @@ export interface Performance { * ``` */ removeConsole?: boolean | ConsoleType[] | undefined + + /** + * Whether to print the file sizes after production build. + * + * {@link Performance.printFileSize} + * + * @example + * + * If you don't want to print any information, you can disable it by setting printFileSize to false: + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: false + * }, + * }) + * ``` + */ + printFileSize?: boolean | PrintFileSize | undefined } diff --git a/packages/rspeedy/core/src/config/performance/print-file-size.ts b/packages/rspeedy/core/src/config/performance/print-file-size.ts new file mode 100644 index 0000000000..45cdade6a6 --- /dev/null +++ b/packages/rspeedy/core/src/config/performance/print-file-size.ts @@ -0,0 +1,134 @@ +// Copyright 2024 The Lynx Authors. All rights reserved. +// Licensed under the Apache License Version 2.0 that can be found in the +// LICENSE file in the root directory of this source tree. + +/** + * {@inheritdoc Performance.printFileSize} + * + * @public + */ +export interface PrintFileSize { + /** + * Whether to output the total size of all static assets. + * + * @example + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * total: false, + * }, + * }, + * }) + * ``` + */ + total?: boolean + + /** + * Whether to output the size of each static asset. + * + * @example + * + * If you don't need to view the size of each static asset, you can set detail to false. In this case, only the total size will be output: + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * detail: false, + * }, + * }, + * }) + * ``` + */ + detail?: boolean + + /** + * Whether to output the gzip-compressed size of each static asset. + * + * @example + * + * If you don't need to view the gzipped size, you can set compressed to false. This can save some gzip computation time for large projects: + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * compressed: false, + * }, + * }, + * }) + * ``` + */ + compressed?: boolean + + /** + * A filter function to determine which static assets to print. + * + * If returned false, the static asset will be excluded and not included in the total size or detailed size. + * + * @example + * + * only output static assets larger than 10kB: + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * include: (asset) => asset.size > 10 * 1000, + * } + * }, + * }) + * ``` + */ + include?: ((asset: PrintFileSizeAsset) => boolean) | undefined + + /** + * A filter function to determine which static assets to exclude. If both include and exclude are set, exclude will take precedence. + * + * Rsbuild defaults to excluding source map, license files, and .d.ts type files, as these files do not affect page load performance. + * + * @example + * + * exclude .html files in addition to the default: + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * exclude: (asset) => + * /\.(?:map|LICENSE\.txt)$/.test(asset.name) || + * /\.html$/.test(asset.name), + * } + * }, + * }) + * ``` + */ + exclude?: ((asset: PrintFileSizeAsset) => boolean) | undefined +} + +/** + * @public + */ +export interface PrintFileSizeAsset { + /** + * The name of the static asset. + * @example 'index.html', 'static/js/index.[hash].js' + */ + name: string + /** + * The size of the static asset in bytes. + */ + size: number +} diff --git a/packages/rspeedy/core/src/config/rsbuild/index.ts b/packages/rspeedy/core/src/config/rsbuild/index.ts index ccec0d4c13..9636093f08 100644 --- a/packages/rspeedy/core/src/config/rsbuild/index.ts +++ b/packages/rspeedy/core/src/config/rsbuild/index.ts @@ -90,6 +90,8 @@ export function toRsbuildConfig( | ConsoleType[] | false | undefined, + + printFileSize: config.performance?.printFileSize ?? true, }, tools: { bundlerChain: config.tools?.bundlerChain, diff --git a/packages/rspeedy/core/src/index.ts b/packages/rspeedy/core/src/index.ts index 494717df07..d813440a75 100644 --- a/packages/rspeedy/core/src/index.ts +++ b/packages/rspeedy/core/src/index.ts @@ -61,6 +61,10 @@ export type { ChunkSplitCustom, } from './config/performance/chunk-split.js' export type { ConsoleType } from './config/performance/index.js' +export type { + PrintFileSize, + PrintFileSizeAsset, +} from './config/performance/print-file-size.js' // RsbuildPlugin export type { RsbuildPlugin, RsbuildPluginAPI } from '@rsbuild/core' diff --git a/packages/rspeedy/core/test/config/performance.test-d.ts b/packages/rspeedy/core/test/config/performance.test-d.ts index 2d788a8974..d2638db4a0 100644 --- a/packages/rspeedy/core/test/config/performance.test-d.ts +++ b/packages/rspeedy/core/test/config/performance.test-d.ts @@ -213,4 +213,44 @@ describe('Config - Performance', () => { removeConsole: false, }) }) + + test('performance.printFileSize', () => { + assertType({ + printFileSize: undefined, + }) + assertType({ + printFileSize: {}, + }) + assertType({ + printFileSize: true, + }) + assertType({ + printFileSize: false, + }) + assertType({ + printFileSize: { + detail: false, + }, + }) + assertType({ + printFileSize: { + total: false, + }, + }) + assertType({ + printFileSize: { + compressed: false, + }, + }) + assertType({ + printFileSize: { + include: () => false, + }, + }) + assertType({ + printFileSize: { + exclude: () => true, + }, + }) + }) }) diff --git a/packages/rspeedy/core/test/config/rsbuild.test.ts b/packages/rspeedy/core/test/config/rsbuild.test.ts index f8e82978b3..cf56bdf08d 100644 --- a/packages/rspeedy/core/test/config/rsbuild.test.ts +++ b/packages/rspeedy/core/test/config/rsbuild.test.ts @@ -5,6 +5,7 @@ import type { RsbuildPlugin } from '@rsbuild/core' import { describe, expect, test } from 'vitest' import { toRsbuildConfig } from '../../src/config/rsbuild/index.js' +import type { PrintFileSize } from '../../src/index.js' describe('Config - toRsBuildConfig', () => { describe('Dev', () => { @@ -450,6 +451,36 @@ describe('Config - toRsBuildConfig', () => { }) expect(rsbuildConfig.performance?.removeConsole).toBe(false) }) + + test('transform performance.printFileSize false', () => { + const rsbuildConfig = toRsbuildConfig({ + performance: { printFileSize: false }, + }) + expect(rsbuildConfig.performance?.printFileSize).toBe( + false, + ) + }) + + test('transform performance.printFileSize', () => { + const rsbuildConfig = toRsbuildConfig({ + performance: { + printFileSize: { + total: false, + detail: false, + compressed: true, + include: () => false, + exclude: () => false, + }, + }, + }) + const printFileSize = rsbuildConfig.performance + ?.printFileSize as PrintFileSize + expect(printFileSize.total).toBe(false) + expect(printFileSize.detail).toBe(false) + expect(printFileSize.compressed).toBe(true) + expect(printFileSize.include?.({ name: '', size: 1 })).toEqual(false) + expect(printFileSize.exclude?.({ name: '', size: 1 })).toEqual(false) + }) }) describe('Plugins', () => { diff --git a/packages/rspeedy/core/test/config/validate.test.ts b/packages/rspeedy/core/test/config/validate.test.ts index af27ce4295..3a6914acf9 100644 --- a/packages/rspeedy/core/test/config/validate.test.ts +++ b/packages/rspeedy/core/test/config/validate.test.ts @@ -1280,6 +1280,49 @@ describe('Config Validation', () => { { removeConsole: ['log', 'foo', 'bar'], }, + { + printFileSize: true, + }, + { + printFileSize: false, + }, + { + printFileSize: {}, + }, + { + printFileSize: { + total: false, + }, + }, + { + printFileSize: { + detail: false, + }, + }, + { + printFileSize: { + compressed: true, + }, + }, + { + printFileSize: { + include: () => false, + }, + }, + { + printFileSize: { + exclude: () => false, + }, + }, + { + printFileSize: { + total: false, + detail: false, + compressed: true, + include: () => false, + exclude: () => false, + }, + }, ] cases.forEach(performance => { @@ -1442,6 +1485,57 @@ describe('Config Validation', () => { - Got: string ] `) + + expect(() => + validate({ + performance: { + printFileSize: { + detail: 0, + }, + }, + }) + ).toThrowErrorMatchingInlineSnapshot(` + [Error: Invalid configuration. + + Invalid config on \`$input.performance.printFileSize.detail\`. + - Expect to be (boolean | undefined) + - Got: number + ] + `) + + expect(() => + validate({ + performance: { + printFileSize: { + total: 0, + }, + }, + }) + ).toThrowErrorMatchingInlineSnapshot(` + [Error: Invalid configuration. + + Invalid config on \`$input.performance.printFileSize.total\`. + - Expect to be (boolean | undefined) + - Got: number + ] + `) + + expect(() => + validate({ + performance: { + printFileSize: { + compressed: 0, + }, + }, + }) + ).toThrowErrorMatchingInlineSnapshot(` + [Error: Invalid configuration. + + Invalid config on \`$input.performance.printFileSize.compressed\`. + - Expect to be (boolean | undefined) + - Got: number + ] + `) }) }) diff --git a/website/rspress.config.ts b/website/rspress.config.ts index 6a5270d7f3..5aee04fa88 100644 --- a/website/rspress.config.ts +++ b/website/rspress.config.ts @@ -112,6 +112,8 @@ const SIDEBARS = { 'EntryDescription', 'RsdoctorRspackPluginOptions', 'SourceMap', + 'PrintFileSize', + 'PrintFileSizeAsset', 'TransformImport', // APIs From c94825edce9c805659fafe3f7186289544502bf7 Mon Sep 17 00:00:00 2001 From: babu-ch Date: Wed, 26 Mar 2025 19:37:19 +0900 Subject: [PATCH 2/4] feat(rspeedy): use rsbuild type feat(rspeedy): use rsbuild type --- packages/rspeedy/core/etc/rspeedy.api.md | 18 +-- .../core/src/config/performance/index.ts | 97 ++++++++++++- .../src/config/performance/print-file-size.ts | 134 ------------------ packages/rspeedy/core/src/index.ts | 4 - website/rspress.config.ts | 2 - 5 files changed, 97 insertions(+), 158 deletions(-) delete mode 100644 packages/rspeedy/core/src/config/performance/print-file-size.ts diff --git a/packages/rspeedy/core/etc/rspeedy.api.md b/packages/rspeedy/core/etc/rspeedy.api.md index 30c3518d44..b1dfbcc3df 100644 --- a/packages/rspeedy/core/etc/rspeedy.api.md +++ b/packages/rspeedy/core/etc/rspeedy.api.md @@ -6,6 +6,7 @@ import type { CreateRsbuildOptions } from '@rsbuild/core'; import { logger } from '@rsbuild/core'; +import type { PerformanceConfig } from '@rsbuild/core'; import type { RsbuildConfig } from '@rsbuild/core'; import type { RsbuildInstance } from '@rsbuild/core'; import { RsbuildPlugin } from '@rsbuild/core'; @@ -232,25 +233,10 @@ export interface Output { // @public export interface Performance { chunkSplit?: ChunkSplit | ChunkSplitBySize | ChunkSplitCustom | undefined; - printFileSize?: boolean | PrintFileSize | undefined; + printFileSize?: PerformanceConfig['printFileSize'] | undefined; removeConsole?: boolean | ConsoleType[] | undefined; } -// @public -export interface PrintFileSize { - compressed?: boolean; - detail?: boolean; - exclude?: ((asset: PrintFileSizeAsset) => boolean) | undefined; - include?: ((asset: PrintFileSizeAsset) => boolean) | undefined; - total?: boolean; -} - -// @public (undocumented) -export interface PrintFileSizeAsset { - name: string; - size: number; -} - export { RsbuildPlugin } export { RsbuildPluginAPI } diff --git a/packages/rspeedy/core/src/config/performance/index.ts b/packages/rspeedy/core/src/config/performance/index.ts index 2d52a0cbb5..aaa763db5d 100644 --- a/packages/rspeedy/core/src/config/performance/index.ts +++ b/packages/rspeedy/core/src/config/performance/index.ts @@ -1,12 +1,13 @@ // Copyright 2024 The Lynx Authors. All rights reserved. // Licensed under the Apache License Version 2.0 that can be found in the // LICENSE file in the root directory of this source tree. +import type { PerformanceConfig } from '@rsbuild/core' + import type { ChunkSplit, ChunkSplitBySize, ChunkSplitCustom, } from './chunk-split.js' -import type { PrintFileSize } from './print-file-size.js' /** * The type of the console method. @@ -87,6 +88,98 @@ export interface Performance { * }, * }) * ``` + * + * @example + * + * Set total to false to disable total size output. + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * total: false, + * }, + * }, + * }) + * ``` + * + * @example + * + * Set detail to false to disable per-asset size output. + * + * If you don't need to view the size of each static asset, you can set detail to false. In this case, only the total size will be output: + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * detail: false, + * }, + * }, + * }) + * ``` + * + * @example + * + * If you don't need to view the gzipped size, you can set compressed to false. This can save some gzip computation time for large projects: + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * compressed: false, + * }, + * }, + * }) + * ``` + * + * @example + * + * To include only static assets that meet certain criteria, use a filter function with include. + * + * If returned false, the static asset will be excluded and not included in the total size or detailed size. + * + * only output static assets larger than 10kB: + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * include: (asset) => asset.size > 10 * 1000, + * } + * }, + * }) + * ``` + * + * @example + * + * To exclude static assets that meet certain criteria, use a filter function with exclude. If both include and exclude are set, exclude will take precedence. + * + * Rspeedy defaults to excluding source map, license files, and .d.ts type files, as these files do not affect page load performance. + * + * exclude .html files in addition to the default: + * + * ```ts + * import { defineConfig } from '@lynx-js/rspeedy' + * + * export default defineConfig({ + * performance: { + * printFileSize: { + * exclude: (asset) => + * /\.(?:map|LICENSE\.txt)$/.test(asset.name) || + * /\.html$/.test(asset.name), + * } + * }, + * }) + * ``` */ - printFileSize?: boolean | PrintFileSize | undefined + printFileSize?: PerformanceConfig['printFileSize'] | undefined } diff --git a/packages/rspeedy/core/src/config/performance/print-file-size.ts b/packages/rspeedy/core/src/config/performance/print-file-size.ts deleted file mode 100644 index 45cdade6a6..0000000000 --- a/packages/rspeedy/core/src/config/performance/print-file-size.ts +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2024 The Lynx Authors. All rights reserved. -// Licensed under the Apache License Version 2.0 that can be found in the -// LICENSE file in the root directory of this source tree. - -/** - * {@inheritdoc Performance.printFileSize} - * - * @public - */ -export interface PrintFileSize { - /** - * Whether to output the total size of all static assets. - * - * @example - * - * ```ts - * import { defineConfig } from '@lynx-js/rspeedy' - * - * export default defineConfig({ - * performance: { - * printFileSize: { - * total: false, - * }, - * }, - * }) - * ``` - */ - total?: boolean - - /** - * Whether to output the size of each static asset. - * - * @example - * - * If you don't need to view the size of each static asset, you can set detail to false. In this case, only the total size will be output: - * - * ```ts - * import { defineConfig } from '@lynx-js/rspeedy' - * - * export default defineConfig({ - * performance: { - * printFileSize: { - * detail: false, - * }, - * }, - * }) - * ``` - */ - detail?: boolean - - /** - * Whether to output the gzip-compressed size of each static asset. - * - * @example - * - * If you don't need to view the gzipped size, you can set compressed to false. This can save some gzip computation time for large projects: - * - * ```ts - * import { defineConfig } from '@lynx-js/rspeedy' - * - * export default defineConfig({ - * performance: { - * printFileSize: { - * compressed: false, - * }, - * }, - * }) - * ``` - */ - compressed?: boolean - - /** - * A filter function to determine which static assets to print. - * - * If returned false, the static asset will be excluded and not included in the total size or detailed size. - * - * @example - * - * only output static assets larger than 10kB: - * - * ```ts - * import { defineConfig } from '@lynx-js/rspeedy' - * - * export default defineConfig({ - * performance: { - * printFileSize: { - * include: (asset) => asset.size > 10 * 1000, - * } - * }, - * }) - * ``` - */ - include?: ((asset: PrintFileSizeAsset) => boolean) | undefined - - /** - * A filter function to determine which static assets to exclude. If both include and exclude are set, exclude will take precedence. - * - * Rsbuild defaults to excluding source map, license files, and .d.ts type files, as these files do not affect page load performance. - * - * @example - * - * exclude .html files in addition to the default: - * - * ```ts - * import { defineConfig } from '@lynx-js/rspeedy' - * - * export default defineConfig({ - * performance: { - * printFileSize: { - * exclude: (asset) => - * /\.(?:map|LICENSE\.txt)$/.test(asset.name) || - * /\.html$/.test(asset.name), - * } - * }, - * }) - * ``` - */ - exclude?: ((asset: PrintFileSizeAsset) => boolean) | undefined -} - -/** - * @public - */ -export interface PrintFileSizeAsset { - /** - * The name of the static asset. - * @example 'index.html', 'static/js/index.[hash].js' - */ - name: string - /** - * The size of the static asset in bytes. - */ - size: number -} diff --git a/packages/rspeedy/core/src/index.ts b/packages/rspeedy/core/src/index.ts index d813440a75..494717df07 100644 --- a/packages/rspeedy/core/src/index.ts +++ b/packages/rspeedy/core/src/index.ts @@ -61,10 +61,6 @@ export type { ChunkSplitCustom, } from './config/performance/chunk-split.js' export type { ConsoleType } from './config/performance/index.js' -export type { - PrintFileSize, - PrintFileSizeAsset, -} from './config/performance/print-file-size.js' // RsbuildPlugin export type { RsbuildPlugin, RsbuildPluginAPI } from '@rsbuild/core' diff --git a/website/rspress.config.ts b/website/rspress.config.ts index 5aee04fa88..6a5270d7f3 100644 --- a/website/rspress.config.ts +++ b/website/rspress.config.ts @@ -112,8 +112,6 @@ const SIDEBARS = { 'EntryDescription', 'RsdoctorRspackPluginOptions', 'SourceMap', - 'PrintFileSize', - 'PrintFileSizeAsset', 'TransformImport', // APIs From 167216cadc1877282608a93c6a3e0b461b4c4f0e Mon Sep 17 00:00:00 2001 From: babu-ch Date: Wed, 26 Mar 2025 20:09:43 +0900 Subject: [PATCH 3/4] feat(rspeedy): fix type test --- .../rspeedy/core/test/config/rsbuild.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/rspeedy/core/test/config/rsbuild.test.ts b/packages/rspeedy/core/test/config/rsbuild.test.ts index cf56bdf08d..8a2bd70495 100644 --- a/packages/rspeedy/core/test/config/rsbuild.test.ts +++ b/packages/rspeedy/core/test/config/rsbuild.test.ts @@ -5,7 +5,6 @@ import type { RsbuildPlugin } from '@rsbuild/core' import { describe, expect, test } from 'vitest' import { toRsbuildConfig } from '../../src/config/rsbuild/index.js' -import type { PrintFileSize } from '../../src/index.js' describe('Config - toRsBuildConfig', () => { describe('Dev', () => { @@ -462,19 +461,20 @@ describe('Config - toRsBuildConfig', () => { }) test('transform performance.printFileSize', () => { + const printFileSizeOptions = { + total: false, + detail: false, + compressed: true, + include: (_: { name: string, size: number }) => false, + exclude: (_: { name: string, size: number }) => false, + } const rsbuildConfig = toRsbuildConfig({ performance: { - printFileSize: { - total: false, - detail: false, - compressed: true, - include: () => false, - exclude: () => false, - }, + printFileSize: printFileSizeOptions, }, }) const printFileSize = rsbuildConfig.performance - ?.printFileSize as PrintFileSize + ?.printFileSize as typeof printFileSizeOptions expect(printFileSize.total).toBe(false) expect(printFileSize.detail).toBe(false) expect(printFileSize.compressed).toBe(true) From 1750b7f1793c6c203ddcc5c962a7678a9e298e68 Mon Sep 17 00:00:00 2001 From: babu-ch Date: Wed, 26 Mar 2025 21:06:19 +0900 Subject: [PATCH 4/4] feat(rspeedy): add doc link --- packages/rspeedy/core/src/config/performance/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/rspeedy/core/src/config/performance/index.ts b/packages/rspeedy/core/src/config/performance/index.ts index aaa763db5d..012c22a6e9 100644 --- a/packages/rspeedy/core/src/config/performance/index.ts +++ b/packages/rspeedy/core/src/config/performance/index.ts @@ -75,6 +75,8 @@ export interface Performance { * * {@link Performance.printFileSize} * + * See {@link https://rsbuild.dev/config/performance/print-file-size | Rsbuild - performance.printFileSize} for details. + * * @example * * If you don't want to print any information, you can disable it by setting printFileSize to false: