diff --git a/packages/rspack-test-tools/src/case/cache.ts b/packages/rspack-test-tools/src/case/cache.ts index fe0539b3a922..a8830369cd46 100644 --- a/packages/rspack-test-tools/src/case/cache.ts +++ b/packages/rspack-test-tools/src/case/cache.ts @@ -273,6 +273,12 @@ function createRunner( await updatePlugin.goNext(); const stats = await compiler.build(); const jsonStats = stats.toJson({ + assets: true, + chunks: true, + chunkModules: true, + modules: true, + entrypoints: true, + chunkGroups: true, // errorDetails: true }); await checkStats(jsonStats); @@ -294,6 +300,10 @@ function createRunner( compiler.createCompiler(); const stats = await compiler.build(); const jsonStats = stats.toJson({ + assets: true, + chunks: true, + entrypoints: true, + chunkGroups: true, // errorDetails: true }); await checkStats(jsonStats); @@ -321,6 +331,10 @@ function createRunner( compiler.createCompiler(); const stats = await compiler.build(); const jsonStats = stats.toJson({ + assets: true, + chunks: true, + entrypoints: true, + chunkGroups: true, // errorDetails: true }); diff --git a/packages/rspack-test-tools/src/case/common.ts b/packages/rspack-test-tools/src/case/common.ts index 4ec35f6a46ca..484bbc24b880 100644 --- a/packages/rspack-test-tools/src/case/common.ts +++ b/packages/rspack-test-tools/src/case/common.ts @@ -143,6 +143,10 @@ export async function check( if (testConfig.writeStatsJson) { const jsonStats = stats.toJson({ + assets: true, + chunks: true, + entrypoints: true, + chunkGroups: true, errorDetails: true, }); fs.writeFileSync( @@ -159,6 +163,12 @@ export async function check( stats.hasWarnings() ) { const statsJson = stats.toJson({ + assets: true, + chunks: true, + chunkModules: true, + modules: true, + entrypoints: true, + chunkGroups: true, errorDetails: true, }); if (statsJson.errors) { diff --git a/packages/rspack-test-tools/src/case/compiler.ts b/packages/rspack-test-tools/src/case/compiler.ts index 6c154eefef59..635051f7bddc 100644 --- a/packages/rspack-test-tools/src/case/compiler.ts +++ b/packages/rspack-test-tools/src/case/compiler.ts @@ -113,7 +113,12 @@ function createCompilerProcessor( expect(typeof stats).toBe('object'); const compilation = stats.compilation; const statsJson = stats.toJson({ + assets: true, + chunks: true, + chunkModules: true, modules: true, + entrypoints: true, + chunkGroups: true, reasons: true, }); expect(typeof statsJson).toBe('object'); diff --git a/packages/rspack-test-tools/src/case/hot.ts b/packages/rspack-test-tools/src/case/hot.ts index 91bb55745e93..2c5b2f5828ab 100644 --- a/packages/rspack-test-tools/src/case/hot.ts +++ b/packages/rspack-test-tools/src/case/hot.ts @@ -254,6 +254,12 @@ export function createHotRunner( throw new Error('Should generate stats during build'); } const jsonStats = stats.toJson({ + assets: true, + chunks: true, + chunkModules: true, + modules: true, + entrypoints: true, + chunkGroups: true, // errorDetails: true }); const compilerOptions = compiler.getOptions(); diff --git a/packages/rspack-test-tools/src/case/runner.ts b/packages/rspack-test-tools/src/case/runner.ts index 7c4c3ef51471..8379bfd30313 100644 --- a/packages/rspack-test-tools/src/case/runner.ts +++ b/packages/rspack-test-tools/src/case/runner.ts @@ -40,6 +40,12 @@ export function cachedStats( return cached; } cached = compiler.getStats()!.toJson({ + assets: true, + chunks: true, + chunkModules: true, + modules: true, + entrypoints: true, + chunkGroups: true, errorDetails: true, }); return cached; diff --git a/packages/rspack-test-tools/src/case/watch.ts b/packages/rspack-test-tools/src/case/watch.ts index 977d237cb55b..b54d1b39ddf5 100644 --- a/packages/rspack-test-tools/src/case/watch.ts +++ b/packages/rspack-test-tools/src/case/watch.ts @@ -157,6 +157,12 @@ export function createWatchInitialProcessor( return () => { if (!cached) { cached = stats.toJson({ + assets: true, + chunks: true, + chunkModules: true, + modules: true, + entrypoints: true, + chunkGroups: true, errorDetails: true, }); } @@ -202,6 +208,12 @@ export function createWatchInitialProcessor( stats.hasWarnings() ) { const statsJson = stats.toJson({ + assets: true, + chunks: true, + chunkModules: true, + modules: true, + entrypoints: true, + chunkGroups: true, errorDetails: true, }); if (statsJson.errors) { @@ -428,6 +440,11 @@ function cachedWatchStats( return cached[stepName]; } cached[stepName] = compiler.getStats()!.toJson({ + entrypoints: true, + assets: true, + chunks: true, + chunkModules: true, + modules: true, errorDetails: true, }); return cached[stepName]; diff --git a/packages/rspack/src/stats/DefaultStatsPresetPlugin.ts b/packages/rspack/src/stats/DefaultStatsPresetPlugin.ts index 9f28745079a9..98578a4ddc7a 100644 --- a/packages/rspack/src/stats/DefaultStatsPresetPlugin.ts +++ b/packages/rspack/src/stats/DefaultStatsPresetPlugin.ts @@ -29,6 +29,7 @@ const NAMED_PRESETS: Record = { entrypoints: true, chunkGroups: true, ids: true, + assets: true, modules: false, chunks: true, chunkRelations: true, @@ -60,11 +61,13 @@ const NAMED_PRESETS: Record = { detailed: { hash: true, builtAt: true, + assets: true, relatedAssets: true, entrypoints: true, chunkGroups: true, ids: true, chunks: true, + modules: true, chunkRelations: true, chunkModules: false, chunkOrigins: true, @@ -151,6 +154,8 @@ const AUTO_FOR_TO_STRING: StatsFunc = ({ all }, { forToString }) => { return true; }; +// NOTE: Unlike webpack's defaults, Rspack uses minimal stats defaults to reduce JS-Rust communication overhead. +// The default behavior aligns with the 'errors-warnings' preset for both toString() and toJson() output. const DEFAULTS: StatsDefault = { // context: (options, context, compilation) => compilation.compiler.context, // requestShortener: (options, context, compilation) => @@ -163,14 +168,14 @@ const DEFAULTS: StatsDefault = { version: NORMAL_ON, timings: NORMAL_ON, builtAt: OFF_FOR_TO_STRING, - assets: NORMAL_ON, - entrypoints: AUTO_FOR_TO_STRING, - chunkGroups: OFF_FOR_TO_STRING, + assets: NORMAL_OFF, + entrypoints: NORMAL_OFF, + chunkGroups: NORMAL_OFF, chunkGroupAuxiliary: OFF_FOR_TO_STRING, chunkGroupChildren: OFF_FOR_TO_STRING, chunkGroupMaxAssets: (_, { forToString }) => forToString ? 5 : Number.POSITIVE_INFINITY, - chunks: OFF_FOR_TO_STRING, + chunks: NORMAL_OFF, chunkRelations: OFF_FOR_TO_STRING, chunkModules: ({ all, modules }) => { if (all === false) return false; @@ -181,12 +186,7 @@ const DEFAULTS: StatsDefault = { dependentModules: OFF_FOR_TO_STRING, chunkOrigins: OFF_FOR_TO_STRING, ids: OFF_FOR_TO_STRING, - modules: ({ all, chunks, chunkModules }, { forToString }) => { - if (all === false) return false; - if (all === true) return true; - if (forToString && chunks && chunkModules) return false; - return true; - }, + modules: NORMAL_OFF, nestedModules: OFF_FOR_TO_STRING, groupModulesByType: ON_FOR_TO_STRING, groupModulesByCacheStatus: ON_FOR_TO_STRING, diff --git a/tests/e2e/cases/lazy-compilation/persistent-cache/rspack.config.js b/tests/e2e/cases/lazy-compilation/persistent-cache/rspack.config.js index b000590525ef..2838ad10fc21 100644 --- a/tests/e2e/cases/lazy-compilation/persistent-cache/rspack.config.js +++ b/tests/e2e/cases/lazy-compilation/persistent-cache/rspack.config.js @@ -13,7 +13,7 @@ module.exports = { { apply(compiler) { compiler.hooks.done.tap('TEST', function (stats) { - const { modules } = stats.toJson(); + const { modules } = stats.toJson({ modules: true }); compiler.__modules = modules.map((item) => item.identifier); }); }, diff --git a/tests/rspack-test/cacheCases/common/module-asset/rspack.config.js b/tests/rspack-test/cacheCases/common/module-asset/rspack.config.js index 3beb4c65013c..f96d56a1b1d1 100644 --- a/tests/rspack-test/cacheCases/common/module-asset/rspack.config.js +++ b/tests/rspack-test/cacheCases/common/module-asset/rspack.config.js @@ -18,7 +18,7 @@ module.exports = { apply(compiler) { compiler.hooks.done.tap("Test", function (stats) { let s = stats.toJson({ - assets: true + all: true }); expect(s.assets.some(item => item.name === "a.txt")).toBeTruthy(); }); diff --git a/tests/rspack-test/compilerCases/banner-plugin.js b/tests/rspack-test/compilerCases/banner-plugin.js index fb94053601cf..8cc3c5df1f98 100644 --- a/tests/rspack-test/compilerCases/banner-plugin.js +++ b/tests/rspack-test/compilerCases/banner-plugin.js @@ -46,7 +46,7 @@ module.exports = [{ }); }, async check() { - const { assets } = lastStats.toJson(); + const { assets } = lastStats.toJson({ assets: true }); expect(assets.find(as => as.name === "entry1.js").emitted).toBe(false); expect(assets.find(as => as.name === "entry2.js").emitted).toBe(true); } diff --git a/tests/rspack-test/compilerCases/consistent.js b/tests/rspack-test/compilerCases/consistent.js index deaa0b1005d9..1ba82053389f 100644 --- a/tests/rspack-test/compilerCases/consistent.js +++ b/tests/rspack-test/compilerCases/consistent.js @@ -25,11 +25,11 @@ module.exports = { if (err) { throw err } - stats.push(stat.toJson().assets) + stats.push(stat.toJson({ assets: true }).assets) compiler.run((_, stat) => { - stats.push(stat.toJson().assets) + stats.push(stat.toJson({ assets: true }).assets) compiler.run((_, stat) => { - stats.push(stat.toJson().assets) + stats.push(stat.toJson({ assets: true }).assets) resolve(); }); }); diff --git a/tests/rspack-test/configCases/split-chunks/external-modules/rspack.config.js b/tests/rspack-test/configCases/split-chunks/external-modules/rspack.config.js index 1d4b5ab86611..e169667b239e 100644 --- a/tests/rspack-test/configCases/split-chunks/external-modules/rspack.config.js +++ b/tests/rspack-test/configCases/split-chunks/external-modules/rspack.config.js @@ -41,7 +41,7 @@ module.exports = { }), compiler => { compiler.hooks.afterEmit.tap("PLUGIN", compilation => { - const stats = compilation.getStats().toJson(); + const stats = compilation.getStats().toJson({ chunks: true }); const entryChunk = stats.chunks.find(chunk => chunk.entry); expect(entryChunk.modules[0].name).toBe('external "./external"'); }); diff --git a/tests/rspack-test/hashCases/issue-7992/test.config.js b/tests/rspack-test/hashCases/issue-7992/test.config.js index a46d1eba05e1..5e641a238270 100644 --- a/tests/rspack-test/hashCases/issue-7992/test.config.js +++ b/tests/rspack-test/hashCases/issue-7992/test.config.js @@ -1,7 +1,7 @@ /** @type {import('@rspack/test-tools').THashCaseConfig} */ module.exports = { validate(stats) { - const assets = stats.stats[0].toJson().assets.map(i => i.name); + const assets = stats.stats[0].toJson({ assets: true }).assets.map(i => i.name); assets.sort(); expect(assets).toEqual([ "file1.c30068f3cc748ce3.svg", diff --git a/tests/rspack-test/hashCases/real-content-hash-md4/test.config.js b/tests/rspack-test/hashCases/real-content-hash-md4/test.config.js index 4b7a60201c81..3f0980c8bcc6 100644 --- a/tests/rspack-test/hashCases/real-content-hash-md4/test.config.js +++ b/tests/rspack-test/hashCases/real-content-hash-md4/test.config.js @@ -3,7 +3,7 @@ /** @type {import('@rspack/test-tools').THashCaseConfig} */ module.exports = { validate(stats) { - const assets = stats.stats[0].toJson().assets.map(i => i.name); + const assets = stats.stats[0].toJson({ assets: true }).assets.map(i => i.name); assets.sort(); // `afc10c70ed4ce2b33593` = md4 of src/file.svg expect(assets).toEqual(["afc10c70ed4ce2b33593.svg", "main.js"]); diff --git a/tests/rspack-test/hashCases/real-content-hash-sha256/test.config.js b/tests/rspack-test/hashCases/real-content-hash-sha256/test.config.js index c04bd446ec37..4b1f39c7b2f4 100644 --- a/tests/rspack-test/hashCases/real-content-hash-sha256/test.config.js +++ b/tests/rspack-test/hashCases/real-content-hash-sha256/test.config.js @@ -3,7 +3,7 @@ /** @type {import("@rspack/test-tools").THashCaseConfig} */ module.exports = { validate(stats) { - const assets = stats.stats[0].toJson().assets.map(i => i.name); + const assets = stats.stats[0].toJson({ assets: true }).assets.map(i => i.name); assets.sort(); // `04c785ed39b3beedfad58de4438c4e905d1da406dc6a1b9ed043ebc574819baa` = sha256 of src/file.svg diff --git a/tests/rspack-test/hashCases/real-content-hash-xxhash64/test.config.js b/tests/rspack-test/hashCases/real-content-hash-xxhash64/test.config.js index bf55a6701e8c..0abdfa3b7120 100644 --- a/tests/rspack-test/hashCases/real-content-hash-xxhash64/test.config.js +++ b/tests/rspack-test/hashCases/real-content-hash-xxhash64/test.config.js @@ -3,7 +3,7 @@ /** @type {import("@rspack/test-tools").THashCaseConfig} */ module.exports = { validate(stats) { - const assets = stats.stats[0].toJson().assets.map(i => i.name); + const assets = stats.stats[0].toJson({ assets: true }).assets.map(i => i.name); assets.sort(); // `c30068f3cc748ce3` = xxhash64 of src/file.svg diff --git a/tests/rspack-test/multiCompilerCases/lazy-compilation.js b/tests/rspack-test/multiCompilerCases/lazy-compilation.js index c9636cb3b112..dfe053d39710 100644 --- a/tests/rspack-test/multiCompilerCases/lazy-compilation.js +++ b/tests/rspack-test/multiCompilerCases/lazy-compilation.js @@ -45,14 +45,14 @@ module.exports = { const [statsA, statsB, statsC] = multiStats.stats; expect( - statsA.toJson().modules.every(module => { + statsA.toJson({ modules: true }).modules.every(module => { return !module.identifier.includes("lazy-compilation-proxy"); }) ).toBeTruthy(); // second compiler lazy compile entry expect( - statsB.toJson().modules.find(module => { + statsB.toJson({ modules: true }).modules.find(module => { return ( module.identifier.includes("lazy-compilation-proxy") && module.identifier.replaceAll("\\", "/").includes("/esm/b.js") @@ -62,7 +62,7 @@ module.exports = { // third compiler lazy compile dyn imports expect( - statsC.toJson().modules.find(module => { + statsC.toJson({ modules: true }).modules.find(module => { return ( module.identifier.includes("lazy-compilation-proxy") && module.identifier diff --git a/tests/rspack-test/statsAPICases/basic.js b/tests/rspack-test/statsAPICases/basic.js index ebccdee64fda..253d9f9568dd 100644 --- a/tests/rspack-test/statsAPICases/basic.js +++ b/tests/rspack-test/statsAPICases/basic.js @@ -11,6 +11,9 @@ module.exports = { }, async check(stats) { const statsOptions = { + assets: true, + modules: true, + chunks: true, all: true, timings: false, builtAt: false, diff --git a/tests/rspack-test/statsAPICases/build-time-executed-runtime.js b/tests/rspack-test/statsAPICases/build-time-executed-runtime.js index e4bcac1db7f8..86a4b3c8fe8f 100644 --- a/tests/rspack-test/statsAPICases/build-time-executed-runtime.js +++ b/tests/rspack-test/statsAPICases/build-time-executed-runtime.js @@ -27,6 +27,7 @@ module.exports = { }, async check(stats) { const statsOptions = { + modules: true, runtimeModules: true, timings: false, builtAt: false, diff --git a/tests/rspack-test/statsAPICases/bundler-info.js b/tests/rspack-test/statsAPICases/bundler-info.js index 75a04c8d5091..e5b9e10fb167 100644 --- a/tests/rspack-test/statsAPICases/bundler-info.js +++ b/tests/rspack-test/statsAPICases/bundler-info.js @@ -14,6 +14,7 @@ module.exports = { }, async check(stats) { const statsOptions = { + modules: true, runtimeModules: true }; expect(typeof stats?.hash).toBe("string"); diff --git a/tests/rspack-test/statsAPICases/chunks.js b/tests/rspack-test/statsAPICases/chunks.js index abb8cac5dbda..1cec175b0097 100644 --- a/tests/rspack-test/statsAPICases/chunks.js +++ b/tests/rspack-test/statsAPICases/chunks.js @@ -25,6 +25,8 @@ module.exports = { }, async check(stats) { const statsChunks = stats?.toJson({ + assets: true, + modules: true, chunks: true, timings: false, builtAt: false, diff --git a/tests/rspack-test/statsAPICases/exports.js b/tests/rspack-test/statsAPICases/exports.js index 73355640f605..60fb2cd5f130 100644 --- a/tests/rspack-test/statsAPICases/exports.js +++ b/tests/rspack-test/statsAPICases/exports.js @@ -17,6 +17,12 @@ module.exports = { }, async check(stats) { const statsOptions = { + entrypoints: true, + assets: true, + chunks: true, + chunkModules: true, + chunkGroups: true, + modules: true, usedExports: true, providedExports: true, timings: false, @@ -1220,7 +1226,15 @@ module.exports = { warningsCount: 0, } `); - expect(stats?.toString(statsOptions)).toMatchInlineSnapshot(` + expect(stats?.toString({ + assets: true, + modules: true, + usedExports: true, + providedExports: true, + timings: false, + builtAt: false, + version: false + })).toMatchInlineSnapshot(` asset main.js 403 bytes [emitted] (name: main) orphan modules 192 bytes [orphan] 4 modules runtime modules 647 bytes 3 modules diff --git a/tests/rspack-test/statsAPICases/nested-modules.js b/tests/rspack-test/statsAPICases/nested-modules.js index 7179b6bb7e1d..79efab8cbc85 100644 --- a/tests/rspack-test/statsAPICases/nested-modules.js +++ b/tests/rspack-test/statsAPICases/nested-modules.js @@ -14,6 +14,7 @@ module.exports = { }, async check(stats) { const statsOptions = { + assets: true, modules: true, nestedModules: true, timings: false, diff --git a/tests/rspack-test/statsAPICases/placeholders.js b/tests/rspack-test/statsAPICases/placeholders.js index 47856041c1f8..a40a4735a3d9 100644 --- a/tests/rspack-test/statsAPICases/placeholders.js +++ b/tests/rspack-test/statsAPICases/placeholders.js @@ -4,7 +4,9 @@ class TestPlugin { apply(compiler) { compiler.hooks.thisCompilation.tap("custom", compilation => { compilation.hooks.optimizeModules.tap("test plugin", () => { - stats = compiler._lastCompilation.getStats().toJson({}); + stats = compiler._lastCompilation.getStats().toJson({ + entrypoints: true, + }); }); }); } diff --git a/tests/rspack-test/statsAPICases/to-string.js b/tests/rspack-test/statsAPICases/to-string.js index c41512c492b6..c30a9f6d9544 100644 --- a/tests/rspack-test/statsAPICases/to-string.js +++ b/tests/rspack-test/statsAPICases/to-string.js @@ -8,7 +8,12 @@ module.exports = { }; }, async check(stats) { - expect(stats?.toString({ timings: false, version: false })) + expect(stats?.toString({ + assets: true, + modules: true, + timings: false, + version: false + })) .toMatchInlineSnapshot(` asset main.js 317 bytes [emitted] (name: main) ./fixtures/abc.js 83 bytes [built] [code generated] diff --git a/tests/rspack-test/statsOutputCases/asset-concat/rspack.config.js b/tests/rspack-test/statsOutputCases/asset-concat/rspack.config.js index bddf54d48d61..15c3681a5697 100644 --- a/tests/rspack-test/statsOutputCases/asset-concat/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/asset-concat/rspack.config.js @@ -31,5 +31,9 @@ module.exports = { }, output: { filename: "bundle.js" + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/asset/rspack.config.js b/tests/rspack-test/statsOutputCases/asset/rspack.config.js index 86679de66531..1b0460f87cd0 100644 --- a/tests/rspack-test/statsOutputCases/asset/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/asset/rspack.config.js @@ -34,5 +34,9 @@ module.exports = { }, output: { filename: "bundle.js" + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/async-commons-chunk-auto/rspack.config.js b/tests/rspack-test/statsOutputCases/async-commons-chunk-auto/rspack.config.js index 3e66efd42e5a..a79bbfa4e105 100644 --- a/tests/rspack-test/statsOutputCases/async-commons-chunk-auto/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/async-commons-chunk-auto/rspack.config.js @@ -6,7 +6,8 @@ const stats = { assets: false, chunks: true, chunkOrigins: true, - modules: false + modules: false, + entrypoints: 'auto', }; /** @type {import("@rspack/core").Configuration[]} */ module.exports = [ diff --git a/tests/rspack-test/statsOutputCases/child-compiler-apply-entry-option/rspack.config.js b/tests/rspack-test/statsOutputCases/child-compiler-apply-entry-option/rspack.config.js index 62aab4b7759a..edcf1f538c7a 100644 --- a/tests/rspack-test/statsOutputCases/child-compiler-apply-entry-option/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/child-compiler-apply-entry-option/rspack.config.js @@ -18,6 +18,8 @@ module.exports = { }) ], stats: { + assets: true, + modules: true, children: true, entrypoints: true } diff --git a/tests/rspack-test/statsOutputCases/chunks-development/rspack.config.js b/tests/rspack-test/statsOutputCases/chunks-development/rspack.config.js index bf72502b76c3..be892def8072 100644 --- a/tests/rspack-test/statsOutputCases/chunks-development/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/chunks-development/rspack.config.js @@ -7,6 +7,7 @@ module.exports = { }, profile: true, stats: { + assets: true, reasons: true, chunks: true, chunkModules: true, diff --git a/tests/rspack-test/statsOutputCases/chunks/rspack.config.js b/tests/rspack-test/statsOutputCases/chunks/rspack.config.js index c8511a24a5e8..9083c89c836b 100644 --- a/tests/rspack-test/statsOutputCases/chunks/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/chunks/rspack.config.js @@ -7,6 +7,7 @@ module.exports = { }, profile: true, stats: { + assets: true, reasons: true, chunks: true, chunkModules: true, diff --git a/tests/rspack-test/statsOutputCases/color-disabled/rspack.config.js b/tests/rspack-test/statsOutputCases/color-disabled/rspack.config.js index f09b72406dc2..52da7a81f0cb 100644 --- a/tests/rspack-test/statsOutputCases/color-disabled/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/color-disabled/rspack.config.js @@ -3,6 +3,8 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, + modules: true, colors: false } }; diff --git a/tests/rspack-test/statsOutputCases/color-enabled/rspack.config.js b/tests/rspack-test/statsOutputCases/color-enabled/rspack.config.js index 34b2dbed203a..9feb5afc586e 100644 --- a/tests/rspack-test/statsOutputCases/color-enabled/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/color-enabled/rspack.config.js @@ -3,6 +3,8 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, + modules: true, colors: true } }; diff --git a/tests/rspack-test/statsOutputCases/common-libs/rspack.config.js b/tests/rspack-test/statsOutputCases/common-libs/rspack.config.js index 3a71594846bc..38c3949aefac 100644 --- a/tests/rspack-test/statsOutputCases/common-libs/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/common-libs/rspack.config.js @@ -7,5 +7,9 @@ module.exports = { optimization: { minimize: true, chunkIds: "named" + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/commons-chunk-min-size-0/rspack.config.js b/tests/rspack-test/statsOutputCases/commons-chunk-min-size-0/rspack.config.js index aee94ba9fcad..1cfa78a0b7c0 100644 --- a/tests/rspack-test/statsOutputCases/commons-chunk-min-size-0/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/commons-chunk-min-size-0/rspack.config.js @@ -14,5 +14,10 @@ module.exports = { } } } + }, + stats: { + entrypoints: 'auto', + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/commons-chunk-min-size-Infinity/rspack.config.js b/tests/rspack-test/statsOutputCases/commons-chunk-min-size-Infinity/rspack.config.js index e584310db863..842ed35c60f9 100644 --- a/tests/rspack-test/statsOutputCases/commons-chunk-min-size-Infinity/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/commons-chunk-min-size-Infinity/rspack.config.js @@ -15,5 +15,10 @@ module.exports = { } } } + }, + stats: { + entrypoints: 'auto', + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/rspack.config.js b/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/rspack.config.js index 93a846afcf96..429490cfa463 100644 --- a/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/rspack.config.js @@ -20,6 +20,10 @@ module.exports = [ } } } + }, + stats: { + assets: true, + modules: true, } }, { @@ -41,6 +45,10 @@ module.exports = [ } } } + }, + stats: { + assets: true, + modules: true, } } ]; diff --git a/tests/rspack-test/statsOutputCases/concatenated-modules/rspack.config.js b/tests/rspack-test/statsOutputCases/concatenated-modules/rspack.config.js index 70bab07d7bec..6c95aa0e8bd6 100644 --- a/tests/rspack-test/statsOutputCases/concatenated-modules/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/concatenated-modules/rspack.config.js @@ -4,5 +4,9 @@ module.exports = { optimization: { concatenateModules: true, minimize: false + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/css-concat/rspack.config.js b/tests/rspack-test/statsOutputCases/css-concat/rspack.config.js index deb8af2eb441..a3748cc2d46e 100644 --- a/tests/rspack-test/statsOutputCases/css-concat/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/css-concat/rspack.config.js @@ -7,5 +7,10 @@ module.exports = { }, experiments: { css: true + }, + stats: { + entrypoints: true, + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/custom-terser/rspack.config.js b/tests/rspack-test/statsOutputCases/custom-terser/rspack.config.js index 59e69bc14877..60507fbae9d4 100644 --- a/tests/rspack-test/statsOutputCases/custom-terser/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/custom-terser/rspack.config.js @@ -21,6 +21,7 @@ module.exports = { ] }, stats: { + assets: true, chunkModules: false, modules: true, providedExports: true, diff --git a/tests/rspack-test/statsOutputCases/details-error/rspack.config.js b/tests/rspack-test/statsOutputCases/details-error/rspack.config.js index 7fef18f5a8b0..2f162eb3c2c5 100644 --- a/tests/rspack-test/statsOutputCases/details-error/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/details-error/rspack.config.js @@ -17,5 +17,9 @@ module.exports = [0, 1, 10, 2, 20, 11, 12, 13, 3, 30].map(n => ({ for (let i = (n / 10) | 0; i > 0; i--) compilation.warnings.push(err); }); } - ] + ], + stats: { + assets: true, + modules: true, + } })); diff --git a/tests/rspack-test/statsOutputCases/dynamic-chunk-name-error/rspack.config.js b/tests/rspack-test/statsOutputCases/dynamic-chunk-name-error/rspack.config.js index a50de8bcedd7..a244029dc24e 100644 --- a/tests/rspack-test/statsOutputCases/dynamic-chunk-name-error/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/dynamic-chunk-name-error/rspack.config.js @@ -5,5 +5,9 @@ module.exports = { entry1: "./entry-1.js", entry2: "./entry-2.js", entry3: "./entry-3.js" + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/dynamic-import/rspack.config.js b/tests/rspack-test/statsOutputCases/dynamic-import/rspack.config.js index 394b3cf19295..8cfda68896d7 100644 --- a/tests/rspack-test/statsOutputCases/dynamic-import/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/dynamic-import/rspack.config.js @@ -20,5 +20,10 @@ module.exports = { optimization: { runtimeChunk: "single", splitChunks: { chunks: "all", name: "common" } + }, + stats: { + entrypoints: true, + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/entry-filename/rspack.config.js b/tests/rspack-test/statsOutputCases/entry-filename/rspack.config.js index b7a225db0e86..64e7a20694f0 100644 --- a/tests/rspack-test/statsOutputCases/entry-filename/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/entry-filename/rspack.config.js @@ -7,6 +7,7 @@ module.exports = { }, profile: true, stats: { + assets: true, reasons: true, chunks: true, chunkModules: true, diff --git a/tests/rspack-test/statsOutputCases/errors-space-error/rspack.config.js b/tests/rspack-test/statsOutputCases/errors-space-error/rspack.config.js index 1abec799109e..ab0140c6c740 100644 --- a/tests/rspack-test/statsOutputCases/errors-space-error/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/errors-space-error/rspack.config.js @@ -4,6 +4,8 @@ module.exports = [ entry: "./loader!./index.js", mode: "production", stats: { + assets: true, + modules: true, errorsSpace: 0, errors: true } @@ -12,6 +14,8 @@ module.exports = [ entry: "./loader!./index.js", mode: "production", stats: { + assets: true, + modules: true, errorsSpace: 2, // 2 errors (2 errors without details) errors: true } @@ -20,6 +24,8 @@ module.exports = [ entry: "./loader!./index.js", mode: "production", stats: { + assets: true, + modules: true, errorsSpace: 3, // 2 errors (2 errors without details) errors: true } @@ -28,6 +34,8 @@ module.exports = [ entry: "./loader!./index.js", mode: "production", stats: { + assets: true, + modules: true, errorsSpace: 4, // 2 errors + 2 lines (2 errors, one with partial details) errors: true } @@ -36,6 +44,8 @@ module.exports = [ entry: "./loader!./index.js", mode: "production", stats: { + assets: true, + modules: true, errorsSpace: 5, // 2 errors + 3 lines (2 errors, one full details) errors: true } @@ -44,6 +54,8 @@ module.exports = [ entry: "./loader!./index.js", mode: "production", stats: { + assets: true, + modules: true, errorsSpace: 100, errors: true } diff --git a/tests/rspack-test/statsOutputCases/exclude-with-loader/rspack.config.js b/tests/rspack-test/statsOutputCases/exclude-with-loader/rspack.config.js index b2a4d22a327f..24f3ac4f06fc 100644 --- a/tests/rspack-test/statsOutputCases/exclude-with-loader/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/exclude-with-loader/rspack.config.js @@ -6,6 +6,8 @@ module.exports = { filename: "bundle.js" }, stats: { + assets: true, + modules: true, excludeModules: ["node_modules", "exclude"], excludeAssets: [/\.json/] }, diff --git a/tests/rspack-test/statsOutputCases/external/rspack.config.js b/tests/rspack-test/statsOutputCases/external/rspack.config.js index 59953fb0a24a..e9f563b6512b 100644 --- a/tests/rspack-test/statsOutputCases/external/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/external/rspack.config.js @@ -4,5 +4,9 @@ module.exports = { entry: "./index", externals: { test: "commonjs test" + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/filename/rspack.config.js b/tests/rspack-test/statsOutputCases/filename/rspack.config.js index 2b5b34272a62..8ee66e3ac4e2 100644 --- a/tests/rspack-test/statsOutputCases/filename/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/filename/rspack.config.js @@ -6,5 +6,9 @@ module.exports = { output: { filename: "[id].xxxx.js", chunkFilename: "[id].xxxx.js" + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/hot+production/rspack.config.js b/tests/rspack-test/statsOutputCases/hot+production/rspack.config.js index feea2f50bc21..b0f0311e8675 100644 --- a/tests/rspack-test/statsOutputCases/hot+production/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/hot+production/rspack.config.js @@ -6,5 +6,9 @@ module.exports = { main: "./index.js" }, plugins: [new rspack.HotModuleReplacementPlugin()], - mode: "production" + mode: "production", + stats: { + assets: true, + modules: true, + } }; diff --git a/tests/rspack-test/statsOutputCases/ignore-warnings/rspack.config.js b/tests/rspack-test/statsOutputCases/ignore-warnings/rspack.config.js index c93ad92099d7..2e03cb140fb9 100644 --- a/tests/rspack-test/statsOutputCases/ignore-warnings/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/ignore-warnings/rspack.config.js @@ -13,5 +13,9 @@ module.exports = { warning => { return warning.module.identifier().endsWith("?2"); } - ] + ], + stats: { + assets: true, + modules: true, + } }; diff --git a/tests/rspack-test/statsOutputCases/import-context-filter/rspack.config.js b/tests/rspack-test/statsOutputCases/import-context-filter/rspack.config.js index a70971cb5863..159fa6da80c5 100644 --- a/tests/rspack-test/statsOutputCases/import-context-filter/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/import-context-filter/rspack.config.js @@ -3,5 +3,9 @@ module.exports = { mode: "production", entry: { entry: "./entry" + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/import-weak-parser-option/rspack.config.js b/tests/rspack-test/statsOutputCases/import-weak-parser-option/rspack.config.js index 1b1d09e98a90..3ccd5e9e3e9a 100644 --- a/tests/rspack-test/statsOutputCases/import-weak-parser-option/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/import-weak-parser-option/rspack.config.js @@ -10,5 +10,9 @@ module.exports = { dynamicImportMode: "weak" } } + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/import-weak/rspack.config.js b/tests/rspack-test/statsOutputCases/import-weak/rspack.config.js index a70971cb5863..159fa6da80c5 100644 --- a/tests/rspack-test/statsOutputCases/import-weak/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/import-weak/rspack.config.js @@ -3,5 +3,9 @@ module.exports = { mode: "production", entry: { entry: "./entry" + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/import-with-invalid-options-comments/rspack.config.js b/tests/rspack-test/statsOutputCases/import-with-invalid-options-comments/rspack.config.js index 13d5f455d66e..ed5d2ba1f4fb 100644 --- a/tests/rspack-test/statsOutputCases/import-with-invalid-options-comments/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/import-with-invalid-options-comments/rspack.config.js @@ -6,6 +6,7 @@ module.exports = { chunkFilename: "[name].js" }, stats: { + modules: true, timings: false, hash: false, entrypoints: false, diff --git a/tests/rspack-test/statsOutputCases/issue-7577/rspack.config.js b/tests/rspack-test/statsOutputCases/issue-7577/rspack.config.js index 297d7adff4d6..8f3180a4ae04 100644 --- a/tests/rspack-test/statsOutputCases/issue-7577/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/issue-7577/rspack.config.js @@ -13,6 +13,11 @@ const base = { } } } + }, + stats: { + entrypoints: true, + assets: true, + modules: true, } }; /** @type {import("@rspack/core").Configuration[]} */ diff --git a/tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/rspack.config.js b/tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/rspack.config.js index 46ca682b4f0e..3356b5878c52 100644 --- a/tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/limit-chunk-count-plugin copy/rspack.config.js @@ -13,6 +13,7 @@ module.exports = [1, 2, 3, 4].map(n => ({ }) ], stats: { + assets: true, chunkModules: true, dependentModules: true, chunkRelations: true, diff --git a/tests/rspack-test/statsOutputCases/limit-chunk-count-plugin/rspack.config.js b/tests/rspack-test/statsOutputCases/limit-chunk-count-plugin/rspack.config.js index cf5574c2bb93..7d46984e8cd2 100644 --- a/tests/rspack-test/statsOutputCases/limit-chunk-count-plugin/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/limit-chunk-count-plugin/rspack.config.js @@ -15,6 +15,7 @@ module.exports = [1, 2, 3, 4].map(n => ({ }) ], stats: { + assets: true, chunkModules: true, // dependentModules: true, chunkRelations: true, diff --git a/tests/rspack-test/statsOutputCases/logging-debug/rspack.config.js b/tests/rspack-test/statsOutputCases/logging-debug/rspack.config.js index 26ccfbaff05b..efd2cd48e438 100644 --- a/tests/rspack-test/statsOutputCases/logging-debug/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/logging-debug/rspack.config.js @@ -15,6 +15,8 @@ module.exports = { }, plugins: [new LogTestPlugin(true)], stats: { + assets: true, + modules: true, colors: true, logging: false, loggingDebug: /custom-loader/ diff --git a/tests/rspack-test/statsOutputCases/logging/rspack.config.js b/tests/rspack-test/statsOutputCases/logging/rspack.config.js index a057de0d8f20..c49952057f00 100644 --- a/tests/rspack-test/statsOutputCases/logging/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/logging/rspack.config.js @@ -15,6 +15,8 @@ module.exports = { }, plugins: [new LogTestPlugin(true)], stats: { + assets: true, + modules: true, colors: true, logging: true, loggingDebug: "custom-loader", diff --git a/tests/rspack-test/statsOutputCases/max-external-module-readable-identifier/rspack.config.js b/tests/rspack-test/statsOutputCases/max-external-module-readable-identifier/rspack.config.js index 0e4205173747..c34391375621 100644 --- a/tests/rspack-test/statsOutputCases/max-external-module-readable-identifier/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/max-external-module-readable-identifier/rspack.config.js @@ -4,5 +4,9 @@ module.exports = { entry: "./index", externals: { test: "commonjs very-very-very-very-long-external-module-readable-identifier-it-should-be-truncated" + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/max-modules-default/rspack.config.js b/tests/rspack-test/statsOutputCases/max-modules-default/rspack.config.js index c0e4f7484403..6b3eb888d5d2 100644 --- a/tests/rspack-test/statsOutputCases/max-modules-default/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/max-modules-default/rspack.config.js @@ -2,5 +2,9 @@ module.exports = { mode: "production", entry: "./index", - performance: false + performance: false, + stats: { + assets: true, + modules: true, + } }; diff --git a/tests/rspack-test/statsOutputCases/max-modules/rspack.config.js b/tests/rspack-test/statsOutputCases/max-modules/rspack.config.js index 78e3ccbab867..e50f70baf77f 100644 --- a/tests/rspack-test/statsOutputCases/max-modules/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/max-modules/rspack.config.js @@ -4,6 +4,8 @@ module.exports = { entry: "./index", performance: false, stats: { + assets: true, + modules: true, modulesSpace: 20 } }; diff --git a/tests/rspack-test/statsOutputCases/module-assets/rspack.config.js b/tests/rspack-test/statsOutputCases/module-assets/rspack.config.js index fb0bff684089..7245f002bbd4 100644 --- a/tests/rspack-test/statsOutputCases/module-assets/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/module-assets/rspack.config.js @@ -3,6 +3,7 @@ module.exports = { mode: "production", entry: "./index", stats: { + entrypoints: true, assets: true, chunkGroups: true, chunkGroupAuxiliary: true, diff --git a/tests/rspack-test/statsOutputCases/module-deduplication-named/rspack.config.js b/tests/rspack-test/statsOutputCases/module-deduplication-named/rspack.config.js index 1d8763546b43..3e2f81ea9bf6 100644 --- a/tests/rspack-test/statsOutputCases/module-deduplication-named/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/module-deduplication-named/rspack.config.js @@ -10,6 +10,7 @@ module.exports = { filename: "[name].js" }, stats: { + assets: true, hash: false, timings: false, builtAt: false, diff --git a/tests/rspack-test/statsOutputCases/module-deduplication/rspack.config.js b/tests/rspack-test/statsOutputCases/module-deduplication/rspack.config.js index 1d8763546b43..3e2f81ea9bf6 100644 --- a/tests/rspack-test/statsOutputCases/module-deduplication/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/module-deduplication/rspack.config.js @@ -10,6 +10,7 @@ module.exports = { filename: "[name].js" }, stats: { + assets: true, hash: false, timings: false, builtAt: false, diff --git a/tests/rspack-test/statsOutputCases/module-reasons/rspack.config.js b/tests/rspack-test/statsOutputCases/module-reasons/rspack.config.js index 1811fb694398..a90be1ebd80c 100644 --- a/tests/rspack-test/statsOutputCases/module-reasons/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/module-reasons/rspack.config.js @@ -3,6 +3,7 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, modules: true, reasons: true } diff --git a/tests/rspack-test/statsOutputCases/module-trace-disabled-in-error/rspack.config.js b/tests/rspack-test/statsOutputCases/module-trace-disabled-in-error/rspack.config.js index 7f550b4b474e..92b56717e8cd 100644 --- a/tests/rspack-test/statsOutputCases/module-trace-disabled-in-error/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/module-trace-disabled-in-error/rspack.config.js @@ -3,6 +3,8 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, + modules: true, hash: false, moduleTrace: false, errorDetails: false diff --git a/tests/rspack-test/statsOutputCases/module-trace-enabled-in-error/rspack.config.js b/tests/rspack-test/statsOutputCases/module-trace-enabled-in-error/rspack.config.js index 3f710ca6245a..a38e8a97267a 100644 --- a/tests/rspack-test/statsOutputCases/module-trace-enabled-in-error/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/module-trace-enabled-in-error/rspack.config.js @@ -3,6 +3,8 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, + modules: true, hash: false, moduleTrace: true, errorDetails: false diff --git a/tests/rspack-test/statsOutputCases/name/rspack.config.js b/tests/rspack-test/statsOutputCases/name/rspack.config.js index 1fd35c0d8bb5..4d5d150c5b54 100644 --- a/tests/rspack-test/statsOutputCases/name/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/name/rspack.config.js @@ -6,6 +6,10 @@ module.exports = [ entry: "./app.js", output: { filename: "bundle1.js" + }, + stats: { + assets: true, + modules: true, } }, { @@ -14,6 +18,10 @@ module.exports = [ entry: "./server.js", output: { filename: "bundle2.js" + }, + stats: { + assets: true, + modules: true, } } ]; diff --git a/tests/rspack-test/statsOutputCases/named-chunks-plugin-async/rspack.config.js b/tests/rspack-test/statsOutputCases/named-chunks-plugin-async/rspack.config.js index 717f4a30f7e6..bd29a903bbf1 100644 --- a/tests/rspack-test/statsOutputCases/named-chunks-plugin-async/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/named-chunks-plugin-async/rspack.config.js @@ -7,4 +7,8 @@ module.exports = { entry: { entry: "./entry" }, + stats: { + assets: true, + modules: true, + } }; diff --git a/tests/rspack-test/statsOutputCases/named-chunks-plugin/rspack.config.js b/tests/rspack-test/statsOutputCases/named-chunks-plugin/rspack.config.js index a36ea314e450..1f8f7eb0ec16 100644 --- a/tests/rspack-test/statsOutputCases/named-chunks-plugin/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/named-chunks-plugin/rspack.config.js @@ -17,5 +17,10 @@ module.exports = { } } } + }, + stats: { + entrypoints: true, + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/optimize-chunks/rspack.config.js b/tests/rspack-test/statsOutputCases/optimize-chunks/rspack.config.js index 3981b0e5b72e..1331f609aaa4 100644 --- a/tests/rspack-test/statsOutputCases/optimize-chunks/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/optimize-chunks/rspack.config.js @@ -3,6 +3,7 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, ids: true, reasons: false, modules: false, diff --git a/tests/rspack-test/statsOutputCases/output-module/rspack.config.js b/tests/rspack-test/statsOutputCases/output-module/rspack.config.js index 164dbddbf6ad..ec30168baa90 100644 --- a/tests/rspack-test/statsOutputCases/output-module/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/output-module/rspack.config.js @@ -3,5 +3,9 @@ module.exports = { entry: "./index", experiments: { outputModule: true + }, + stats: { + assets: true, + modules: true, } }; diff --git a/tests/rspack-test/statsOutputCases/performance-different-mode-and-target/rspack.config.js b/tests/rspack-test/statsOutputCases/performance-different-mode-and-target/rspack.config.js index dd7106ae18f0..d309ff354c42 100644 --- a/tests/rspack-test/statsOutputCases/performance-different-mode-and-target/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/performance-different-mode-and-target/rspack.config.js @@ -6,6 +6,10 @@ module.exports = [ target: "web", output: { filename: "warning.pro-web.js" + }, + stats: { + assets: true, + modules: true, } }, { @@ -14,6 +18,10 @@ module.exports = [ target: "webworker", output: { filename: "warning.pro-webworker.js" + }, + stats: { + assets: true, + modules: true, } }, { @@ -22,6 +30,10 @@ module.exports = [ target: "node", output: { filename: "no-warning.pro-node.js" + }, + stats: { + assets: true, + modules: true, } }, { @@ -30,6 +42,10 @@ module.exports = [ target: "web", output: { filename: "no-warning.dev-web.js" + }, + stats: { + assets: true, + modules: true, } }, { @@ -38,6 +54,10 @@ module.exports = [ target: "node", output: { filename: "no-warning.dev-node.js" + }, + stats: { + assets: true, + modules: true, } }, { @@ -49,6 +69,10 @@ module.exports = [ }, output: { filename: "no-warning.dev-web-with-limit-set.js" + }, + stats: { + assets: true, + modules: true, } }, { @@ -60,6 +84,10 @@ module.exports = [ }, output: { filename: "warning.pro-node-with-hints-set.js" + }, + stats: { + assets: true, + modules: true, } } ]; diff --git a/tests/rspack-test/statsOutputCases/performance-disabled/rspack.config.js b/tests/rspack-test/statsOutputCases/performance-disabled/rspack.config.js index 3fa660ef7efb..189a4ca99cbf 100644 --- a/tests/rspack-test/statsOutputCases/performance-disabled/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/performance-disabled/rspack.config.js @@ -3,9 +3,11 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, + modules: true, colors: true, hash: false, entrypoints: true }, - performance: false + performance: false, }; diff --git a/tests/rspack-test/statsOutputCases/performance-error/rspack.config.js b/tests/rspack-test/statsOutputCases/performance-error/rspack.config.js index 678f23ed07bc..abba6dc023f4 100644 --- a/tests/rspack-test/statsOutputCases/performance-error/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/performance-error/rspack.config.js @@ -3,6 +3,8 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, + modules: true, colors: true, hash: false, entrypoints: true diff --git a/tests/rspack-test/statsOutputCases/performance-no-async-chunks-shown/rspack.config.js b/tests/rspack-test/statsOutputCases/performance-no-async-chunks-shown/rspack.config.js index 3a9a7de93d91..41601f0def63 100644 --- a/tests/rspack-test/statsOutputCases/performance-no-async-chunks-shown/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/performance-no-async-chunks-shown/rspack.config.js @@ -9,6 +9,8 @@ module.exports = { hints: "warning" }, stats: { + assets: true, + modules: true, colors: true, hash: false, entrypoints: true diff --git a/tests/rspack-test/statsOutputCases/performance-no-hints/rspack.config.js b/tests/rspack-test/statsOutputCases/performance-no-hints/rspack.config.js index 81f405ee7139..007c9304f3f7 100644 --- a/tests/rspack-test/statsOutputCases/performance-no-hints/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/performance-no-hints/rspack.config.js @@ -3,6 +3,8 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, + modules: true, colors: true, hash: false, entrypoints: true diff --git a/tests/rspack-test/statsOutputCases/performance-oversize-limit-error/rspack.config.js b/tests/rspack-test/statsOutputCases/performance-oversize-limit-error/rspack.config.js index ed87c1d3287b..db81bf21d94f 100644 --- a/tests/rspack-test/statsOutputCases/performance-oversize-limit-error/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/performance-oversize-limit-error/rspack.config.js @@ -6,6 +6,8 @@ module.exports = { sec: "./index2" }, stats: { + assets: true, + modules: true, colors: true, hash: false, entrypoints: true diff --git a/tests/rspack-test/statsOutputCases/preset-mixed-array/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/preset-mixed-array/__snapshots__/stats.txt index 557a1759f411..b325a24fae09 100644 --- a/tests/rspack-test/statsOutputCases/preset-mixed-array/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/preset-mixed-array/__snapshots__/stats.txt @@ -4,8 +4,6 @@ minimal: minimal (Rspack x.x.x) compiled successfully in X s none: - asset none.js xx bytes [emitted] (name: main) - ./index.js xx bytes [built] [code generated] none (Rspack x.x.x) compiled successfully in X s verbose: diff --git a/tests/rspack-test/statsOutputCases/preset-mixed-array/rspack.config.js b/tests/rspack-test/statsOutputCases/preset-mixed-array/rspack.config.js index 99520a5836ef..1079bd5302e6 100644 --- a/tests/rspack-test/statsOutputCases/preset-mixed-array/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/preset-mixed-array/rspack.config.js @@ -28,6 +28,7 @@ module.exports = [ filename: "verbose.js" }, stats: { + modules: true, entrypoints: true, hash: false, timings: false, diff --git a/tests/rspack-test/statsOutputCases/preset-none-error/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/preset-none-error/__snapshots__/stats.txt index a4ff6a26e37c..785c0d73aac9 100644 --- a/tests/rspack-test/statsOutputCases/preset-none-error/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/preset-none-error/__snapshots__/stats.txt @@ -1,6 +1,3 @@ -assets by status xx bytes [cached] 1 asset -./index.js xx bytes [built] [code generated] [1 error] - ERROR in ./index.js 1:9-24 × Module not found: Can't resolve 'does-not-exist' in '/statsOutputCases/preset-none-error' ╭──── diff --git a/tests/rspack-test/statsOutputCases/preset-none/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/preset-none/__snapshots__/stats.txt index 541b26d28a69..2c22e426f2da 100644 --- a/tests/rspack-test/statsOutputCases/preset-none/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/preset-none/__snapshots__/stats.txt @@ -1,7 +1,4 @@ [LogTestPlugin] Error -asset main.js xx bytes [emitted] (name: main) -./index.js xx bytes [built] [code generated] - LOG from LogTestPlugin Error Warning diff --git a/tests/rspack-test/statsOutputCases/preset-normal-performance-ensure-filter-sourcemaps/rspack.config.js b/tests/rspack-test/statsOutputCases/preset-normal-performance-ensure-filter-sourcemaps/rspack.config.js index dd70cf55b18e..f2699f1ea310 100644 --- a/tests/rspack-test/statsOutputCases/preset-normal-performance-ensure-filter-sourcemaps/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/preset-normal-performance-ensure-filter-sourcemaps/rspack.config.js @@ -7,6 +7,8 @@ module.exports = { }, entry: "./index", stats: { + assets: true, + modules: true, hash: false, colors: true } diff --git a/tests/rspack-test/statsOutputCases/preset-normal-performance/rspack.config.js b/tests/rspack-test/statsOutputCases/preset-normal-performance/rspack.config.js index 7ad8833fc361..88d74566513e 100644 --- a/tests/rspack-test/statsOutputCases/preset-normal-performance/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/preset-normal-performance/rspack.config.js @@ -6,6 +6,8 @@ module.exports = { hints: "warning" }, stats: { + assets: true, + modules: true, hash: false, colors: true } diff --git a/tests/rspack-test/statsOutputCases/preset-normal/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/preset-normal/__snapshots__/stats.txt index 93cfa48dec38..7bb0f09349b1 100644 --- a/tests/rspack-test/statsOutputCases/preset-normal/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/preset-normal/__snapshots__/stats.txt @@ -1,11 +1,4 @@ [LogTestPlugin] Error -asset main.js xx KiB [emitted] (name: main) -runtime modules xx bytes 1 module -modules by path ./*.js xx bytes - ./index.js xx bytes [built] [code generated] [2 warnings] - ./a.js xx bytes [built] [code generated] -./.|sync xx bytes [built] [code generated] - LOG from LogTestPlugin Error Warning diff --git a/tests/rspack-test/statsOutputCases/related-assets/rspack.config.js b/tests/rspack-test/statsOutputCases/related-assets/rspack.config.js index 6c0ed3a733d9..f1c6ea1a7d93 100644 --- a/tests/rspack-test/statsOutputCases/related-assets/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/related-assets/rspack.config.js @@ -57,6 +57,7 @@ const base = name => ({ }); const baseStats = { + assets: true, entrypoints: false, modules: false, timings: false, diff --git a/tests/rspack-test/statsOutputCases/resolve-overflow-error/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/resolve-overflow-error/__snapshots__/stats.txt index fad2b17025c4..19fa563c996a 100644 --- a/tests/rspack-test/statsOutputCases/resolve-overflow-error/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/resolve-overflow-error/__snapshots__/stats.txt @@ -1,6 +1,3 @@ -assets by status xx bytes [cached] 1 asset -./index.js xx bytes [built] [code generated] [1 error] - ERROR in ./index.js 1:1-34 × Module not found: Can't resolve 'cycle-alias/a' in '/statsOutputCases/resolve-overflow-error' ╭─[1:0] diff --git a/tests/rspack-test/statsOutputCases/resolve-unexpected-exports-in-pkg-error/rspack.config.js b/tests/rspack-test/statsOutputCases/resolve-unexpected-exports-in-pkg-error/rspack.config.js new file mode 100644 index 000000000000..8d72d29c8451 --- /dev/null +++ b/tests/rspack-test/statsOutputCases/resolve-unexpected-exports-in-pkg-error/rspack.config.js @@ -0,0 +1,11 @@ +module.exports = { + entry: './index.js', + mode: 'development', + stats: { + assets: true, + modules: true, + }, + output: { + filename: 'bundle.js', + } +} diff --git a/tests/rspack-test/statsOutputCases/reverse-sort-modules/rspack.config.js b/tests/rspack-test/statsOutputCases/reverse-sort-modules/rspack.config.js index 912b4971844b..424f08e8cead 100644 --- a/tests/rspack-test/statsOutputCases/reverse-sort-modules/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/reverse-sort-modules/rspack.config.js @@ -4,6 +4,8 @@ module.exports = { entry: "./index", performance: false, stats: { + assets: true, + modules: true, modulesSpace: Infinity, modulesSort: "!name" } diff --git a/tests/rspack-test/statsOutputCases/runtime-chunk-issue-7382/rspack.config.js b/tests/rspack-test/statsOutputCases/runtime-chunk-issue-7382/rspack.config.js index c00693a93ea4..9cd6bcaf2640 100644 --- a/tests/rspack-test/statsOutputCases/runtime-chunk-issue-7382/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/runtime-chunk-issue-7382/rspack.config.js @@ -12,6 +12,7 @@ module.exports = { hash: false, timings: false, builtAt: false, + entrypoints: true, assets: false, modules: false, reasons: true diff --git a/tests/rspack-test/statsOutputCases/runtime-chunk-single/rspack.config.js b/tests/rspack-test/statsOutputCases/runtime-chunk-single/rspack.config.js index d139145b98a1..b57b818722f0 100644 --- a/tests/rspack-test/statsOutputCases/runtime-chunk-single/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/runtime-chunk-single/rspack.config.js @@ -13,6 +13,7 @@ module.exports = { hash: false, timings: false, builtAt: false, + entrypoints: true, assets: false, modules: false, reasons: true diff --git a/tests/rspack-test/statsOutputCases/runtime-chunk/rspack.config.js b/tests/rspack-test/statsOutputCases/runtime-chunk/rspack.config.js index 567c5b3cba6d..32d9ddb419c6 100644 --- a/tests/rspack-test/statsOutputCases/runtime-chunk/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/runtime-chunk/rspack.config.js @@ -12,6 +12,7 @@ module.exports = { hash: false, timings: false, builtAt: false, + entrypoints: true, assets: false, modules: false, reasons: false diff --git a/tests/rspack-test/statsOutputCases/runtime-specific-exports/rspack.config.js b/tests/rspack-test/statsOutputCases/runtime-specific-exports/rspack.config.js index eda18fb9e89a..115df159639d 100644 --- a/tests/rspack-test/statsOutputCases/runtime-specific-exports/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/runtime-specific-exports/rspack.config.js @@ -6,6 +6,8 @@ module.exports = { providedExports: true }, stats: { + assets: true, + modules: true, usedExports: true, providedExports: true } diff --git a/tests/rspack-test/statsOutputCases/runtime-specific-used-exports/rspack.config.js b/tests/rspack-test/statsOutputCases/runtime-specific-used-exports/rspack.config.js index ae3296e9ef30..ac23f40939a0 100644 --- a/tests/rspack-test/statsOutputCases/runtime-specific-used-exports/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/runtime-specific-used-exports/rspack.config.js @@ -5,6 +5,7 @@ const entry = { }; const stats = { + assets: true, usedExports: true, chunks: true, chunkModules: true, diff --git a/tests/rspack-test/statsOutputCases/scope-hoisting-bailouts/rspack.config.js b/tests/rspack-test/statsOutputCases/scope-hoisting-bailouts/rspack.config.js index 5a2c3c0f8906..476f52858418 100644 --- a/tests/rspack-test/statsOutputCases/scope-hoisting-bailouts/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/scope-hoisting-bailouts/rspack.config.js @@ -12,6 +12,7 @@ module.exports = { externals: ["external"], stats: { assets: false, + modules: true, orphanModules: true, optimizationBailout: true } diff --git a/tests/rspack-test/statsOutputCases/scope-hoisting-multi/rspack.config.js b/tests/rspack-test/statsOutputCases/scope-hoisting-multi/rspack.config.js index 0f0443f62865..fbdb00c557d2 100644 --- a/tests/rspack-test/statsOutputCases/scope-hoisting-multi/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/scope-hoisting-multi/rspack.config.js @@ -24,7 +24,8 @@ module.exports = [ } }, stats: { - assets: false + assets: false, + modules: true, } }, @@ -52,6 +53,7 @@ module.exports = [ }, stats: { assets: false, + modules: true, orphanModules: true, optimizationBailout: true } diff --git a/tests/rspack-test/statsOutputCases/side-effects-bailouts/rspack.config.js b/tests/rspack-test/statsOutputCases/side-effects-bailouts/rspack.config.js index dc0448b0d6d1..546d96b68c22 100644 --- a/tests/rspack-test/statsOutputCases/side-effects-bailouts/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/side-effects-bailouts/rspack.config.js @@ -5,6 +5,7 @@ module.exports = { }, mode: "production", stats: { + assets: true, chunks: true, children: true, modules: true, diff --git a/tests/rspack-test/statsOutputCases/side-effects-issue-7428/rspack.config.js b/tests/rspack-test/statsOutputCases/side-effects-issue-7428/rspack.config.js index 60d4aac7a451..a76004c777af 100644 --- a/tests/rspack-test/statsOutputCases/side-effects-issue-7428/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/side-effects-issue-7428/rspack.config.js @@ -8,6 +8,8 @@ module.exports = { concatenateModules: true }, stats: { + assets: true, + modules: true, orphanModules: true, nestedModules: true, usedExports: true, diff --git a/tests/rspack-test/statsOutputCases/side-effects-optimization/rspack.config.js b/tests/rspack-test/statsOutputCases/side-effects-optimization/rspack.config.js index 96ab39c290d3..6328fad9a543 100644 --- a/tests/rspack-test/statsOutputCases/side-effects-optimization/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/side-effects-optimization/rspack.config.js @@ -3,6 +3,8 @@ const baseConfig = { mode: "production", entry: "./index", stats: { + assets: true, + modules: true, modulesSpace: Infinity, optimizationBailout: true, nestedModules: true, diff --git a/tests/rspack-test/statsOutputCases/side-effects-simple-unused/rspack.config.js b/tests/rspack-test/statsOutputCases/side-effects-simple-unused/rspack.config.js index 27bf65451069..f3c0cea0d7be 100644 --- a/tests/rspack-test/statsOutputCases/side-effects-simple-unused/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/side-effects-simple-unused/rspack.config.js @@ -3,6 +3,8 @@ module.exports = { mode: "production", entry: "./index", stats: { + assets: true, + modules: true, orphanModules: true, nestedModules: true, usedExports: true, diff --git a/tests/rspack-test/statsOutputCases/simple-export/rspack.config.js b/tests/rspack-test/statsOutputCases/simple-export/rspack.config.js new file mode 100644 index 000000000000..5c94f18bea21 --- /dev/null +++ b/tests/rspack-test/statsOutputCases/simple-export/rspack.config.js @@ -0,0 +1,12 @@ +module.exports = { + entry: './index.js', + mode: 'development', + stats: { + assets: true, + modules: true, + }, + optimization: { minimize: false }, + output: { + filename: 'bundle.js', + } +} diff --git a/tests/rspack-test/statsOutputCases/simple-module-source/rspack.config.js b/tests/rspack-test/statsOutputCases/simple-module-source/rspack.config.js index 4bf1761db50a..cde3217464f1 100644 --- a/tests/rspack-test/statsOutputCases/simple-module-source/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/simple-module-source/rspack.config.js @@ -7,6 +7,8 @@ module.exports = { filename: "bundle.js" }, stats: { + assets: true, + modules: true, builtAt: false, timings: false, source: true, diff --git a/tests/rspack-test/statsOutputCases/simple-more-info/rspack.config.js b/tests/rspack-test/statsOutputCases/simple-more-info/rspack.config.js index c537ddd35d74..bdc273afd6d4 100644 --- a/tests/rspack-test/statsOutputCases/simple-more-info/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/simple-more-info/rspack.config.js @@ -7,6 +7,7 @@ module.exports = { }, profile: true, stats: { + assets: true, reasons: true, chunkModules: true, dependentModules: true, diff --git a/tests/rspack-test/statsOutputCases/simple/rspack.config.js b/tests/rspack-test/statsOutputCases/simple/rspack.config.js new file mode 100644 index 000000000000..7d3e077f6096 --- /dev/null +++ b/tests/rspack-test/statsOutputCases/simple/rspack.config.js @@ -0,0 +1,10 @@ +module.exports = { + entry: './index.js', + stats: { + assets: true, + modules: true + }, + output: { + filename: 'bundle.js' + } +} diff --git a/tests/rspack-test/statsOutputCases/split-chunks-cache-group-filename/rspack.config.js b/tests/rspack-test/statsOutputCases/split-chunks-cache-group-filename/rspack.config.js index c1d77934dee0..1da983ca5532 100644 --- a/tests/rspack-test/statsOutputCases/split-chunks-cache-group-filename/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/split-chunks-cache-group-filename/rspack.config.js @@ -19,6 +19,7 @@ module.exports = { } }, stats: { + entrypoints: true, assets: false, chunks: true } diff --git a/tests/rspack-test/statsOutputCases/split-chunks-runtime-specific/rspack.config.js b/tests/rspack-test/statsOutputCases/split-chunks-runtime-specific/rspack.config.js index 31d5dab1929e..e49f1eb90b45 100644 --- a/tests/rspack-test/statsOutputCases/split-chunks-runtime-specific/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/split-chunks-runtime-specific/rspack.config.js @@ -4,6 +4,8 @@ const entry = { c: "./c" }; const stats = { + entrypoints: true, + assets: true, chunks: true }; diff --git a/tests/rspack-test/statsOutputCases/stats-hooks/rspack.config.js b/tests/rspack-test/statsOutputCases/stats-hooks/rspack.config.js index a648a02f0345..d8c674c2a8ac 100644 --- a/tests/rspack-test/statsOutputCases/stats-hooks/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/stats-hooks/rspack.config.js @@ -37,6 +37,8 @@ class StatsPrinterTestPlugin { module.exports = { entry: "./index", stats: { + assets: true, + modules: true, builtAt: false, timings: false, version: false diff --git a/tests/rspack-test/statsOutputCases/tree-shaking/rspack.config.js b/tests/rspack-test/statsOutputCases/tree-shaking/rspack.config.js index 69405ee66f11..7950c61574b7 100644 --- a/tests/rspack-test/statsOutputCases/tree-shaking/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/tree-shaking/rspack.config.js @@ -9,6 +9,7 @@ module.exports = { concatenateModules: false }, stats: { + assets: true, chunkModules: false, modules: true, providedExports: true, diff --git a/tests/rspack-test/statsOutputCases/warnings-space-warning/rspack.config.js b/tests/rspack-test/statsOutputCases/warnings-space-warning/rspack.config.js index a48267783b66..475d1d21e1ee 100644 --- a/tests/rspack-test/statsOutputCases/warnings-space-warning/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/warnings-space-warning/rspack.config.js @@ -3,6 +3,8 @@ module.exports = { entry: "./index.js", mode: "production", stats: { + assets: true, + modules: true, warningsSpace: 0, warnings: true } diff --git a/tests/rspack-test/statsOutputCases/wasm-explorer-examples-sync/rspack.config.js b/tests/rspack-test/statsOutputCases/wasm-explorer-examples-sync/rspack.config.js index 90a09b93a8af..5e3b1cf575ef 100644 --- a/tests/rspack-test/statsOutputCases/wasm-explorer-examples-sync/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/wasm-explorer-examples-sync/rspack.config.js @@ -14,6 +14,7 @@ module.exports = { } }, stats: { + assets: true, chunks: true, chunkModules: true, dependentModules: true, diff --git a/tests/rspack-test/statsOutputCases/worker-public-path/rspack.config.js b/tests/rspack-test/statsOutputCases/worker-public-path/rspack.config.js index cd0b245146c9..c2a36c9641f6 100644 --- a/tests/rspack-test/statsOutputCases/worker-public-path/rspack.config.js +++ b/tests/rspack-test/statsOutputCases/worker-public-path/rspack.config.js @@ -4,5 +4,9 @@ module.exports = { entry: "./index.js", output: { filename: "[name]-[contenthash].js" + }, + stats: { + assets: true, + modules: true, } };