From b4af327e6fb552e9e578b58f6a667a7930e9f739 Mon Sep 17 00:00:00 2001 From: GiveMe-A-Name Date: Thu, 23 Jan 2025 16:50:45 +0800 Subject: [PATCH 1/3] feat: add chunk prefetch and preload functionality with EJS templates --- Cargo.lock | 4 +- .../src/runtime_module/auto_public_path.rs | 65 +- .../chunk_prefetch_preload_function.rs | 28 +- .../runtime_module/chunk_prefetch_startup.rs | 36 +- .../runtime_module/chunk_prefetch_trigger.rs | 28 +- .../runtime_module/chunk_preload_trigger.rs | 29 +- .../create_fake_namespace_object.rs | 15 +- .../runtime/auto_public_path.ejs | 25 + .../chunk_prefetch_preload_function.ejs | 6 + .../chunk_prefetch_preload_function.js | 6 - .../runtime/chunk_prefetch_startup.ejs | 3 + .../runtime/chunk_prefetch_trigger.ejs | 7 + .../runtime/chunk_prefetch_trigger.js | 7 - .../runtime/chunk_preload_trigger.ejs | 5 + .../runtime/chunk_preload_trigger.js | 5 - ...ct.js => create_fake_namespace_object.ejs} | 12 +- ...NewCodeSplitting-stats-output.test.js.snap | 46 +- .../__snapshots__/StatsOutput.test.js.snap | 46 +- .../tests/statsAPICases/asset-info.js | 2 +- .../tests/statsAPICases/chunk-group.js | 16 +- .../tests/statsAPICases/chunks.js | 2 +- ...$.css => async.$ae2da65b0213ce5b11bb$.css} | 0 ...0$.css => main.$ae2da65b0213ce5b11bb$.css} | 0 .../chunkFilename-fullhash/expected/main.js | 47 +- .../cases/hmr-locals/expected/main.js | 45 +- .../css-extract/cases/hmr/expected/main.js | 45 +- .../cases/insert-function/expected/main.js | 45 +- .../cases/insert-string/expected/main.js | 45 +- .../cases/insert-undefined/expected/main.js | 45 +- .../cases/issue-6649/expected/main.js | 833 +++++++++--------- .../cases/no-runtime/expected/main.js | 45 +- .../cases/runtime/expected/runtime~main.js | 51 +- .../StatsTestCases.basictest.js.snap | 196 ++--- 33 files changed, 905 insertions(+), 885 deletions(-) create mode 100644 crates/rspack_plugin_runtime/src/runtime_module/runtime/auto_public_path.ejs create mode 100644 crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_preload_function.ejs delete mode 100644 crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_preload_function.js create mode 100644 crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_startup.ejs create mode 100644 crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_trigger.ejs delete mode 100644 crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_trigger.js create mode 100644 crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_preload_trigger.ejs delete mode 100644 crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_preload_trigger.js rename crates/rspack_plugin_runtime/src/runtime_module/runtime/{create_fake_namespace_object.js => create_fake_namespace_object.ejs} (62%) rename tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/{async.$f4608fdcfef13de69f10$.css => async.$ae2da65b0213ce5b11bb$.css} (100%) rename tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/{main.$f4608fdcfef13de69f10$.css => main.$ae2da65b0213ce5b11bb$.css} (100%) diff --git a/Cargo.lock b/Cargo.lock index ff6f3ab8c47d..5111f042fb71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2119,9 +2119,9 @@ dependencies = [ [[package]] name = "hstr" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e963d8fe690aa5ecd16d270b18362b28643862474f7fceabf105fd4c9b3a6a42" +checksum = "4032fdbefb72a4538180ef5dec6d0970e642f30f2e639c4d27e477afb5d97036" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", diff --git a/crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs b/crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs index 8a0235407ce4..06cddf0f16e4 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs +++ b/crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs @@ -3,7 +3,7 @@ use rspack_core::{ get_js_chunk_filename_template, get_undo_path, impl_runtime_module, rspack_sources::{BoxSource, RawStringSource, SourceExt}, ChunkUkey, Compilation, OutputOptions, PathData, RuntimeGlobals, RuntimeModule, - RuntimeModuleStage, SourceType, + RuntimeModuleStage, RuntimeTemplate, SourceType, }; #[impl_runtime_module] @@ -32,6 +32,13 @@ impl RuntimeModule for AutoPublicPathRuntimeModule { RuntimeModuleStage::Attach } + fn template(&self) -> Vec<(String, String)> { + vec![( + self.id.to_string(), + include_str!("runtime/auto_public_path.ejs").to_string(), + )] + } + fn generate(&self, compilation: &Compilation) -> rspack_error::Result { let chunk = self.chunk.expect("The chunk should be attached"); let chunk = compilation.chunk_by_ukey.expect_get(&chunk); @@ -61,15 +68,22 @@ impl RuntimeModule for AutoPublicPathRuntimeModule { )?; Ok( RawStringSource::from(auto_public_path_template( + &compilation.runtime_template, + &self.id, &filename, &compilation.options.output, - )) + )?) .boxed(), ) } } -fn auto_public_path_template(filename: &str, output: &OutputOptions) -> String { +fn auto_public_path_template( + runtime_template: &RuntimeTemplate, + id: &str, + filename: &str, + output: &OutputOptions, +) -> rspack_error::Result { let output_path = output.path.as_str().to_string(); let undo_path = get_undo_path(filename, output_path, false); let assign = if undo_path.is_empty() { @@ -80,45 +94,14 @@ fn auto_public_path_template(filename: &str, output: &OutputOptions) -> String { RuntimeGlobals::PUBLIC_PATH ) }; - let global = RuntimeGlobals::GLOBAL.name(); let import_meta_name = output.import_meta_name.clone(); - let script_url_template = if output.script_type.eq("module") { - format!( - r#"var scriptUrl; - if (typeof {import_meta_name}.url === "string") scriptUrl = {import_meta_name}.url - "# - ) - .to_string() - } else { - format!( - r#"var scriptUrl; - if ({global}.importScripts) scriptUrl = {global}.location + ""; - var document = {global}.document; - if (!scriptUrl && document) {{ - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) {{ - var scripts = document.getElementsByTagName("script"); - if (scripts.length) {{ - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - }} - }} - }} - "# - ) - }; - format!( - r#" - {script_url_template} - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - {assign} - "# + runtime_template.render( + id, + Some(serde_json::json!({ + "script_type": output.script_type, + "IMPORT_META_NAME": import_meta_name, + "ASSIGN": assign + })), ) } diff --git a/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_preload_function.rs b/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_preload_function.rs index 9c9f38be95fb..edee8eb6e800 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_preload_function.rs +++ b/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_preload_function.rs @@ -1,4 +1,3 @@ -use cow_utils::CowUtils; use rspack_collections::Identifier; use rspack_core::{ impl_runtime_module, @@ -36,15 +35,22 @@ impl RuntimeModule for ChunkPrefetchPreloadFunctionRuntimeModule { self.id } - fn generate(&self, _: &Compilation) -> rspack_error::Result { - Ok( - RawStringSource::from( - include_str!("runtime/chunk_prefetch_preload_function.js") - .cow_replace("$RUNTIME_FUNCTION$", &self.runtime_function.to_string()) - .cow_replace("$RUNTIME_HANDLERS$", &self.runtime_handlers.to_string()) - .into_owned(), - ) - .boxed(), - ) + fn template(&self) -> Vec<(String, String)> { + vec![( + self.id.to_string(), + include_str!("runtime/chunk_prefetch_preload_function.ejs").to_string(), + )] + } + + fn generate(&self, compilation: &Compilation) -> rspack_error::Result { + let source = compilation.runtime_template.render( + &self.id, + Some(serde_json::json!({ + "RUNTIME_HANDLERS": &self.runtime_handlers.to_string(), + "RUNTIME_FUNCTION": &self.runtime_function.to_string(), + })), + )?; + + Ok(RawStringSource::from(source).boxed()) } } diff --git a/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_startup.rs b/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_startup.rs index 4b8dfdccbeac..b783cbc3856e 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_startup.rs +++ b/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_startup.rs @@ -33,11 +33,17 @@ impl RuntimeModule for ChunkPrefetchStartupRuntimeModule { self.chunk = Some(chunk); } + fn template(&self) -> Vec<(String, String)> { + vec![( + self.id.to_string(), + include_str!("runtime/chunk_prefetch_startup.ejs").to_string(), + )] + } + fn generate(&self, compilation: &Compilation) -> rspack_error::Result { let chunk_ukey = self.chunk.expect("chunk do not attached"); - Ok( - RawStringSource::from( - self + + let source = self .startup_chunks .iter() .map(|(group_chunks, child_chunks)| { @@ -85,21 +91,15 @@ impl RuntimeModule for ChunkPrefetchStartupRuntimeModule { } }; - format!( - r#" - {}(0, {}, function() {{ - {} - }}, 5); - "#, - RuntimeGlobals::ON_CHUNKS_LOADED, - serde_json::to_string(&group_chunk_ids).expect("invalid json tostring"), - body - ) - }) - .join("\n"), - ) - .boxed(), - ) + let source = compilation.runtime_template.render(&self.id, Some(serde_json::json!({ + "GROUP_CHUNK_IDS": serde_json::to_string(&group_chunk_ids).expect("invalid json tostring"), + "BODY": body, + })))?; + + Ok(source) + }).collect::>>()?.join("\n"); + + Ok(RawStringSource::from(source).boxed()) } fn stage(&self) -> RuntimeModuleStage { diff --git a/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_trigger.rs b/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_trigger.rs index f68c697740eb..d59a168bdd4d 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_trigger.rs +++ b/crates/rspack_plugin_runtime/src/runtime_module/chunk_prefetch_trigger.rs @@ -1,6 +1,5 @@ use std::hash::BuildHasherDefault; -use cow_utils::CowUtils; use indexmap::IndexMap; use rspack_cacheable::with::AsMap; use rspack_collections::Identifier; @@ -34,18 +33,21 @@ impl RuntimeModule for ChunkPrefetchTriggerRuntimeModule { self.id } - fn generate(&self, _: &Compilation) -> rspack_error::Result { - Ok( - RawStringSource::from( - include_str!("runtime/chunk_prefetch_trigger.js") - .cow_replace( - "$CHUNK_MAP$", - &serde_json::to_string(&self.chunk_map).expect("invalid json tostring"), - ) - .into_owned(), - ) - .boxed(), - ) + fn template(&self) -> Vec<(String, String)> { + vec![( + self.id.to_string(), + include_str!("runtime/chunk_prefetch_trigger.ejs").to_string(), + )] + } + + fn generate(&self, compilation: &Compilation) -> rspack_error::Result { + let source = compilation.runtime_template.render( + &self.id, + Some(serde_json::json!({ + "CHUNK_MAP": &self.chunk_map, + })), + )?; + Ok(RawStringSource::from(source).boxed()) } fn stage(&self) -> RuntimeModuleStage { diff --git a/crates/rspack_plugin_runtime/src/runtime_module/chunk_preload_trigger.rs b/crates/rspack_plugin_runtime/src/runtime_module/chunk_preload_trigger.rs index 51137b01df8e..8b938946a957 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/chunk_preload_trigger.rs +++ b/crates/rspack_plugin_runtime/src/runtime_module/chunk_preload_trigger.rs @@ -1,6 +1,5 @@ use std::hash::BuildHasherDefault; -use cow_utils::CowUtils; use indexmap::IndexMap; use rspack_cacheable::with::AsMap; use rspack_collections::Identifier; @@ -34,18 +33,22 @@ impl RuntimeModule for ChunkPreloadTriggerRuntimeModule { self.id } - fn generate(&self, _: &Compilation) -> rspack_error::Result { - Ok( - RawStringSource::from( - include_str!("runtime/chunk_preload_trigger.js") - .cow_replace( - "$CHUNK_MAP$", - &serde_json::to_string(&self.chunk_map).expect("invalid json tostring"), - ) - .into_owned(), - ) - .boxed(), - ) + fn template(&self) -> Vec<(String, String)> { + vec![( + self.id.to_string(), + include_str!("runtime/chunk_preload_trigger.ejs").to_string(), + )] + } + + fn generate(&self, compilation: &Compilation) -> rspack_error::Result { + let source = compilation.runtime_template.render( + &self.id, + Some(serde_json::json!({ + "CHUNK_MAP": &self.chunk_map, + })), + )?; + + Ok(RawStringSource::from(source).boxed()) } fn stage(&self) -> RuntimeModuleStage { diff --git a/crates/rspack_plugin_runtime/src/runtime_module/create_fake_namespace_object.rs b/crates/rspack_plugin_runtime/src/runtime_module/create_fake_namespace_object.rs index c641e0e28a75..bf8c787b5675 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/create_fake_namespace_object.rs +++ b/crates/rspack_plugin_runtime/src/runtime_module/create_fake_namespace_object.rs @@ -24,9 +24,16 @@ impl RuntimeModule for CreateFakeNamespaceObjectRuntimeModule { self.id } - fn generate(&self, _compilation: &Compilation) -> rspack_error::Result { - Ok( - RawStringSource::from_static(include_str!("runtime/create_fake_namespace_object.js")).boxed(), - ) + fn template(&self) -> Vec<(String, String)> { + vec![( + self.id.to_string(), + include_str!("runtime/create_fake_namespace_object.ejs").to_string(), + )] + } + + fn generate(&self, compilation: &Compilation) -> rspack_error::Result { + let source = compilation.runtime_template.render(&self.id, None)?; + + Ok(RawStringSource::from(source).boxed()) } } diff --git a/crates/rspack_plugin_runtime/src/runtime_module/runtime/auto_public_path.ejs b/crates/rspack_plugin_runtime/src/runtime_module/runtime/auto_public_path.ejs new file mode 100644 index 000000000000..778d253e3090 --- /dev/null +++ b/crates/rspack_plugin_runtime/src/runtime_module/runtime/auto_public_path.ejs @@ -0,0 +1,25 @@ +var scriptUrl; +<% if (script_type == "module") { %> +if (typeof <%- IMPORT_META_NAME %>.url === "string") scriptUrl = <%- IMPORT_META_NAME %>.url +<% } else { %> +if (<%- GLOBAL %>.importScripts) scriptUrl = <%- GLOBAL %>.location + ""; +var document = <%- GLOBAL %>.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} +<% } %> +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +<%- ASSIGN %> \ No newline at end of file diff --git a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_preload_function.ejs b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_preload_function.ejs new file mode 100644 index 000000000000..c1d4a2eeefa4 --- /dev/null +++ b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_preload_function.ejs @@ -0,0 +1,6 @@ +<%- RUNTIME_HANDLERS %> = {}; +<%- RUNTIME_FUNCTION %> = <%- basicFunction("chunkId") %> { + Object.keys(<%- RUNTIME_HANDLERS %>).map(function (key) { + <%- RUNTIME_HANDLERS %>[key](chunkId); + }); +} \ No newline at end of file diff --git a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_preload_function.js b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_preload_function.js deleted file mode 100644 index a6c49e51a342..000000000000 --- a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_preload_function.js +++ /dev/null @@ -1,6 +0,0 @@ -$RUNTIME_HANDLERS$ = {}; -$RUNTIME_FUNCTION$ = function (chunkId) { - Object.keys($RUNTIME_HANDLERS$).map(function (key) { - $RUNTIME_HANDLERS$[key](chunkId); - }); -} diff --git a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_startup.ejs b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_startup.ejs new file mode 100644 index 000000000000..067660bc98c9 --- /dev/null +++ b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_startup.ejs @@ -0,0 +1,3 @@ +<%- ON_CHUNKS_LOADED %>(0, <%- GROUP_CHUNK_IDS %>, <%- basicFunction("") %> { + <%- BODY %> +}, 5); \ No newline at end of file diff --git a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_trigger.ejs b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_trigger.ejs new file mode 100644 index 000000000000..02ea0c3452eb --- /dev/null +++ b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_trigger.ejs @@ -0,0 +1,7 @@ +var chunkToChildrenMap = <%- CHUNK_MAP %>; +<%- ENSURE_CHUNK_HANDLERS %>.prefetch = <%- basicFunction("chunkId, promises") %> { + Promise.all(promises).then(<%- basicFunction("") %> { + var chunks = chunkToChildrenMap[chunkId]; + Array.isArray(chunks) && chunks.map(<%- PREFETCH_CHUNK %>); + }); +}; \ No newline at end of file diff --git a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_trigger.js b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_trigger.js deleted file mode 100644 index e144e7a35d9c..000000000000 --- a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_prefetch_trigger.js +++ /dev/null @@ -1,7 +0,0 @@ -var chunkToChildrenMap = $CHUNK_MAP$; -__webpack_require__.f.prefetch = function (chunkId, promises) { - Promise.all(promises).then(function () { - var chunks = chunkToChildrenMap[chunkId]; - Array.isArray(chunks) && chunks.map(__webpack_require__.E); - }); -}; \ No newline at end of file diff --git a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_preload_trigger.ejs b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_preload_trigger.ejs new file mode 100644 index 000000000000..ac31ebc5c0ad --- /dev/null +++ b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_preload_trigger.ejs @@ -0,0 +1,5 @@ +var chunkToChildrenMap = <%- CHUNK_MAP %>; +<%- ENSURE_CHUNK_HANDLERS %>.preload = <%- basicFunction("chunkId") %> { + var chunks = chunkToChildrenMap[chunkId]; + Array.isArray(chunks) && chunks.map(<%- PRELOAD_CHUNK %>); +}; \ No newline at end of file diff --git a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_preload_trigger.js b/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_preload_trigger.js deleted file mode 100644 index bca221978bf5..000000000000 --- a/crates/rspack_plugin_runtime/src/runtime_module/runtime/chunk_preload_trigger.js +++ /dev/null @@ -1,5 +0,0 @@ -var chunkToChildrenMap = $CHUNK_MAP$; -__webpack_require__.f.preload = function (chunkId) { - var chunks = chunkToChildrenMap[chunkId]; - Array.isArray(chunks) && chunks.map(__webpack_require__.G); -}; \ No newline at end of file diff --git a/crates/rspack_plugin_runtime/src/runtime_module/runtime/create_fake_namespace_object.js b/crates/rspack_plugin_runtime/src/runtime_module/runtime/create_fake_namespace_object.ejs similarity index 62% rename from crates/rspack_plugin_runtime/src/runtime_module/runtime/create_fake_namespace_object.js rename to crates/rspack_plugin_runtime/src/runtime_module/runtime/create_fake_namespace_object.ejs index e6e87a1bb2fa..bfde4766ed1d 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/runtime/create_fake_namespace_object.js +++ b/crates/rspack_plugin_runtime/src/runtime_module/runtime/create_fake_namespace_object.ejs @@ -1,4 +1,4 @@ -var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__ }; +var getProto = Object.getPrototypeOf ? <%- returningFunction("Object.getPrototypeOf(obj)", "obj") %> : <%- returningFunction("obj.__proto__", "obj") %>; var leafPrototypes; // create a fake namespace object // mode & 1: value is a module id, require it @@ -6,7 +6,7 @@ var leafPrototypes; // mode & 4: return value when already ns object // mode & 16: return value when it's Promise-like // mode & 8|1: behave like require -__webpack_require__.t = function(value, mode) { +<%- CREATE_FAKE_NAMESPACE_OBJECT %> = function(value, mode) { if(mode & 1) value = this(value); if(mode & 8) return value; if(typeof value === 'object' && value) { @@ -14,13 +14,13 @@ __webpack_require__.t = function(value, mode) { if((mode & 16) && typeof value.then === 'function') return value; } var ns = Object.create(null); - __webpack_require__.r(ns); + <%- MAKE_NAMESPACE_OBJECT %>(ns); var def = {}; leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { - Object.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; } }); + Object.getOwnPropertyNames(current).forEach(<%- basicFunction("key") %> { def[key] = <%- returningFunction("value[key]", "") %> }); } - def['default'] = function() { return value }; - __webpack_require__.d(ns, def); + def['default'] = <%- returningFunction("value", "") %>; + <%- DEFINE_PROPERTY_GETTERS %>(ns, def); return ns; }; \ No newline at end of file diff --git a/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap index f8ced411f6f5..192b6b4df167 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap @@ -2,10 +2,10 @@ exports[`new code splitting stats output new code splitting stats output/auxiliary-files-test should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` PublicPath: auto -asset bundle.js 2.6 KiB {909} [emitted] (name: main) +asset bundle.js 2.49 KiB {909} [emitted] (name: main) asset 98396dbfd5c74c34.png 7 bytes ({909}) [emitted] [immutable] [from: raw.png] (auxiliary name: main) -Entrypoint main 2.6 KiB (7 bytes) = bundle.js 2.6 KiB (98396dbfd5c74c34.png 7 bytes) -chunk {909} (runtime: main) bundle.js (main) 7 bytes (asset) 159 bytes (javascript) 1.61 KiB (runtime) [entry] [rendered] +Entrypoint main 2.49 KiB (7 bytes) = bundle.js 2.49 KiB (98396dbfd5c74c34.png 7 bytes) +chunk {909} (runtime: main) bundle.js (main) 7 bytes (asset) 159 bytes (javascript) 1.5 KiB (runtime) [entry] [rendered] > ./index main ./index.js + 1 modules [686] 117 bytes {909} [depth 0] [code generated] [no exports] @@ -50,8 +50,8 @@ modules by path ./ 235 bytes (javascript) 7 bytes (asset) [exports: default] [no exports used] esm import ./raw.png ./index.js 2:0-33 -runtime modules 1.61 KiB - webpack/runtime/auto_public_path 1.39 KiB {909} [code generated] +runtime modules 1.5 KiB + webpack/runtime/auto_public_path 1.29 KiB {909} [code generated] [no exports] [used exports unknown] webpack/runtime/global 223 bytes {909} [code generated] @@ -85,10 +85,10 @@ Rspack x.x.x compiled successfully in X s `; exports[`new code splitting stats output new code splitting stats output/css-concat should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset main.js 3.78 KiB [emitted] (name: main) +asset main.js 3.67 KiB [emitted] (name: main) asset main.css 24 bytes [emitted] (name: main) -Entrypoint main 3.8 KiB = main.js 3.78 KiB main.css 24 bytes -runtime modules 2.26 KiB 6 modules +Entrypoint main 3.69 KiB = main.js 3.67 KiB main.css 24 bytes +runtime modules 2.16 KiB 6 modules cacheable modules 62 bytes (javascript) 23 bytes (css) ./index.js 20 bytes [built] [code generated] ./foo.css 42 bytes (javascript) 23 bytes (css) [built] [code generated] @@ -106,8 +106,8 @@ Rspack x.x.x compiled successfully in X s `; exports[`new code splitting stats output new code splitting stats output/hot+production should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset main.js 33.5 KiB [emitted] (name: main) -runtime modules 31.2 KiB 12 modules +asset main.js 33.4 KiB [emitted] (name: main) +runtime modules 31.1 KiB 12 modules ./index.js 25 bytes [built] [code generated] Rspack x.x.x compiled successfully in X s `; @@ -142,8 +142,8 @@ Rspack compiled with 1 error exports[`new code splitting stats output new code splitting stats output/limit-chunk-count-plugin should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` 1 chunks: - asset bundle1.js 3.66 KiB [emitted] (name: main) - chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.84 KiB (runtime) <{909}> >{909}< [entry] [rendered] + asset bundle1.js 3.6 KiB [emitted] (name: main) + chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.78 KiB (runtime) <{909}> >{909}< [entry] [rendered] dependent modules 96 bytes [dependent] 4 modules ./index.js 123 bytes [built] [code generated] 1 chunks (Rspack x.x.x) compiled successfully in X s @@ -154,7 +154,7 @@ exports[`new code splitting stats output new code splitting stats output/limit-c chunk (runtime: main) 76.bundle2.js (c) 74 bytes <{76}> <{909}> >{76}< [rendered] dependent modules 44 bytes [dependent] 2 modules ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle2.js (main) 145 bytes (javascript) 8.74 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle2.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 2 chunks (Rspack x.x.x) compiled successfully in X s @@ -168,7 +168,7 @@ exports[`new code splitting stats output new code splitting stats output/limit-c ./e.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle3.js (c) 30 bytes <{909}> >{345}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle3.js (main) 145 bytes (javascript) 8.74 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle3.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 3 chunks (Rspack x.x.x) compiled successfully in X s @@ -184,7 +184,7 @@ exports[`new code splitting stats output new code splitting stats output/limit-c ./d.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle4.js (c) 30 bytes <{909}> >{697}< >{753}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle4.js (main) 145 bytes (javascript) 8.74 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle4.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 4 chunks (Rspack x.x.x) compiled successfully in X s @@ -241,13 +241,13 @@ Rspack compiled with 1 error `; exports[`new code splitting stats output new code splitting stats output/optimization-chunk-ids-natural should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -Entrypoint e1 10.7 KiB = e1.js -Entrypoint e2 10.6 KiB = e2.js +Entrypoint e1 10.6 KiB = e1.js +Entrypoint e2 10.5 KiB = e2.js chunk (runtime: e1) 0.js 24 bytes [rendered] chunk (runtime: e1) 1.js 52 bytes [rendered] chunk (runtime: e1, e2) 2.js 22 bytes [rendered] -chunk (runtime: e1) e1.js (e1) 74 bytes (javascript) 8.73 KiB (runtime) [entry] [rendered] -chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) 8.73 KiB (runtime) [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 74 bytes (javascript) 8.56 KiB (runtime) [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) 8.56 KiB (runtime) [entry] [rendered] `; exports[`new code splitting stats output new code splitting stats output/optimization-runtime-chunk should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` @@ -309,7 +309,7 @@ asset main.js 304 KiB [emitted] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] Entrypoint main 304 KiB = main.js -runtime modules 8.73 KiB 12 modules +runtime modules 8.56 KiB 12 modules cacheable modules 293 KiB ./index.js 49 bytes [built] [code generated] ./a.js 293 KiB [built] [code generated] @@ -325,7 +325,7 @@ asset main.js 304 KiB [emitted] [big] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] Entrypoint main [big] 304 KiB = main.js -runtime modules 8.73 KiB 12 modules +runtime modules 8.56 KiB 12 modules cacheable modules 293 KiB ./index.js 48 bytes [built] [code generated] ./a.js 293 KiB [built] [code generated] @@ -351,7 +351,7 @@ asset main.js 304 KiB [emitted] [big] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] Entrypoint main [big] 304 KiB = main.js -runtime modules 8.73 KiB 12 modules +runtime modules 8.56 KiB 12 modules cacheable modules 293 KiB ./index.js 48 bytes [built] [code generated] ./a.js 293 KiB [built] [code generated] @@ -373,7 +373,7 @@ chunk (runtime: main) a2.js (a2) 1 bytes <{74}> [rendered] chunk (runtime: main) b.js (b) 203 bytes <{909}> >{438}< >{439}< >{826}< (prefetch: {826} {438}) (preload: {439}) [rendered] chunk (runtime: main) c.js (c) 134 bytes <{909}> >{380}< >{433}< (preload: {433} {380}) [rendered] chunk (runtime: main) b1.js (b1) 1 bytes <{751}> [rendered] -chunk (runtime: main) main.js (main) 195 bytes (javascript) 12 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered] +chunk (runtime: main) main.js (main) 195 bytes (javascript) 11.8 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered] `; exports[`new code splitting stats output new code splitting stats output/reasons should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` diff --git a/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap index 5a824054f424..59bbb73e105b 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap @@ -2,10 +2,10 @@ exports[`statsOutput statsOutput/auxiliary-files-test should print correct stats for 1`] = ` PublicPath: auto -asset bundle.js 2.6 KiB {909} [emitted] (name: main) +asset bundle.js 2.49 KiB {909} [emitted] (name: main) asset 98396dbfd5c74c34.png 7 bytes ({909}) [emitted] [immutable] [from: raw.png] (auxiliary name: main) -Entrypoint main 2.6 KiB (7 bytes) = bundle.js 2.6 KiB (98396dbfd5c74c34.png 7 bytes) -chunk {909} (runtime: main) bundle.js (main) 7 bytes (asset) 159 bytes (javascript) 1.61 KiB (runtime) [entry] [rendered] +Entrypoint main 2.49 KiB (7 bytes) = bundle.js 2.49 KiB (98396dbfd5c74c34.png 7 bytes) +chunk {909} (runtime: main) bundle.js (main) 7 bytes (asset) 159 bytes (javascript) 1.5 KiB (runtime) [entry] [rendered] > ./index main ./index.js + 1 modules [686] 117 bytes {909} [depth 0] [code generated] [no exports] @@ -50,8 +50,8 @@ modules by path ./ 235 bytes (javascript) 7 bytes (asset) [exports: default] [no exports used] esm import ./raw.png ./index.js 2:0-33 -runtime modules 1.61 KiB - webpack/runtime/auto_public_path 1.39 KiB {909} [code generated] +runtime modules 1.5 KiB + webpack/runtime/auto_public_path 1.29 KiB {909} [code generated] [no exports] [used exports unknown] webpack/runtime/global 223 bytes {909} [code generated] @@ -85,10 +85,10 @@ Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/css-concat should print correct stats for 1`] = ` -asset main.js 3.78 KiB [emitted] (name: main) +asset main.js 3.67 KiB [emitted] (name: main) asset main.css 24 bytes [emitted] (name: main) -Entrypoint main 3.8 KiB = main.js 3.78 KiB main.css 24 bytes -runtime modules 2.26 KiB 6 modules +Entrypoint main 3.69 KiB = main.js 3.67 KiB main.css 24 bytes +runtime modules 2.16 KiB 6 modules cacheable modules 62 bytes (javascript) 23 bytes (css) ./index.js 20 bytes [built] [code generated] ./foo.css 42 bytes (javascript) 23 bytes (css) [built] [code generated] @@ -106,8 +106,8 @@ Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/hot+production should print correct stats for 1`] = ` -asset main.js 33.5 KiB [emitted] (name: main) -runtime modules 31.2 KiB 12 modules +asset main.js 33.4 KiB [emitted] (name: main) +runtime modules 31.1 KiB 12 modules ./index.js 25 bytes [built] [code generated] Rspack x.x.x compiled successfully in X s `; @@ -142,8 +142,8 @@ Rspack compiled with 1 error exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct stats for 1`] = ` 1 chunks: - asset bundle1.js 3.66 KiB [emitted] (name: main) - chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.84 KiB (runtime) <{909}> >{909}< [entry] [rendered] + asset bundle1.js 3.6 KiB [emitted] (name: main) + chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.78 KiB (runtime) <{909}> >{909}< [entry] [rendered] dependent modules 96 bytes [dependent] 4 modules ./index.js 123 bytes [built] [code generated] 1 chunks (Rspack x.x.x) compiled successfully in X s @@ -154,7 +154,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s chunk (runtime: main) 76.bundle2.js (c) 74 bytes <{76}> <{909}> >{76}< [rendered] dependent modules 44 bytes [dependent] 2 modules ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle2.js (main) 145 bytes (javascript) 8.74 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle2.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 2 chunks (Rspack x.x.x) compiled successfully in X s @@ -168,7 +168,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s ./e.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle3.js (c) 30 bytes <{909}> >{345}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle3.js (main) 145 bytes (javascript) 8.74 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle3.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 3 chunks (Rspack x.x.x) compiled successfully in X s @@ -184,7 +184,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s ./d.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle4.js (c) 30 bytes <{909}> >{697}< >{753}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle4.js (main) 145 bytes (javascript) 8.74 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle4.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 4 chunks (Rspack x.x.x) compiled successfully in X s @@ -241,13 +241,13 @@ Rspack compiled with 1 error `; exports[`statsOutput statsOutput/optimization-chunk-ids-natural should print correct stats for 1`] = ` -Entrypoint e1 10.7 KiB = e1.js -Entrypoint e2 10.6 KiB = e2.js +Entrypoint e1 10.6 KiB = e1.js +Entrypoint e2 10.5 KiB = e2.js chunk (runtime: e1) 0.js 24 bytes [rendered] chunk (runtime: e1) 1.js 52 bytes [rendered] chunk (runtime: e1, e2) 2.js 22 bytes [rendered] -chunk (runtime: e1) e1.js (e1) 74 bytes (javascript) 8.73 KiB (runtime) [entry] [rendered] -chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) 8.73 KiB (runtime) [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 74 bytes (javascript) 8.56 KiB (runtime) [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) 8.56 KiB (runtime) [entry] [rendered] `; exports[`statsOutput statsOutput/optimization-runtime-chunk should print correct stats for 1`] = ` @@ -309,7 +309,7 @@ asset main.js 304 KiB [emitted] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] Entrypoint main 304 KiB = main.js -runtime modules 8.73 KiB 12 modules +runtime modules 8.56 KiB 12 modules cacheable modules 293 KiB ./index.js 49 bytes [built] [code generated] ./a.js 293 KiB [built] [code generated] @@ -325,7 +325,7 @@ asset main.js 304 KiB [emitted] [big] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] Entrypoint main [big] 304 KiB = main.js -runtime modules 8.73 KiB 12 modules +runtime modules 8.56 KiB 12 modules cacheable modules 293 KiB ./index.js 48 bytes [built] [code generated] ./a.js 293 KiB [built] [code generated] @@ -351,7 +351,7 @@ asset main.js 304 KiB [emitted] [big] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] Entrypoint main [big] 304 KiB = main.js -runtime modules 8.73 KiB 12 modules +runtime modules 8.56 KiB 12 modules cacheable modules 293 KiB ./index.js 48 bytes [built] [code generated] ./a.js 293 KiB [built] [code generated] @@ -373,7 +373,7 @@ chunk (runtime: main) a2.js (a2) 1 bytes <{74}> [rendered] chunk (runtime: main) b.js (b) 203 bytes <{909}> >{438}< >{439}< >{826}< (prefetch: {826} {438}) (preload: {439}) [rendered] chunk (runtime: main) c.js (c) 134 bytes <{909}> >{380}< >{433}< (preload: {433} {380}) [rendered] chunk (runtime: main) b1.js (b1) 1 bytes <{751}> [rendered] -chunk (runtime: main) main.js (main) 195 bytes (javascript) 12 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered] +chunk (runtime: main) main.js (main) 195 bytes (javascript) 11.8 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered] `; exports[`statsOutput statsOutput/reasons should print correct stats for 1`] = ` diff --git a/packages/rspack-test-tools/tests/statsAPICases/asset-info.js b/packages/rspack-test-tools/tests/statsAPICases/asset-info.js index c87ba52ce385..6356baa465c6 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/asset-info.js +++ b/packages/rspack-test-tools/tests/statsAPICases/asset-info.js @@ -91,7 +91,7 @@ module.exports = { isOverSizeLimit: false, name: main.js, related: Array [], - size: 2759, + size: 2648, type: asset, }, ] diff --git a/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js b/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js index 17d8a173386c..b1b1a6b81a1f 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js +++ b/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js @@ -26,17 +26,17 @@ module.exports = { assets: Array [ Object { name: main.js, - size: 14544, + size: 14283, }, ], - assetsSize: 14544, + assetsSize: 14283, auxiliaryAssets: Array [ Object { name: main.js.map, - size: 689, + size: 684, }, ], - auxiliaryAssetsSize: 689, + auxiliaryAssetsSize: 684, childAssets: Object {}, children: Object { prefetch: Array [ @@ -215,17 +215,17 @@ module.exports = { assets: Array [ Object { name: main.js, - size: 14544, + size: 14283, }, ], - assetsSize: 14544, + assetsSize: 14283, auxiliaryAssets: Array [ Object { name: main.js.map, - size: 689, + size: 684, }, ], - auxiliaryAssetsSize: 689, + auxiliaryAssetsSize: 684, childAssets: Object {}, children: Object { prefetch: Array [ diff --git a/packages/rspack-test-tools/tests/statsAPICases/chunks.js b/packages/rspack-test-tools/tests/statsAPICases/chunks.js index 5d2b2ef6bcc1..0219c173ef73 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/chunks.js +++ b/packages/rspack-test-tools/tests/statsAPICases/chunks.js @@ -247,7 +247,7 @@ module.exports = { size: 85, sizes: Object { javascript: 85, - runtime: 9140, + runtime: 8965, }, type: chunk, }, diff --git a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/async.$f4608fdcfef13de69f10$.css b/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/async.$ae2da65b0213ce5b11bb$.css similarity index 100% rename from tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/async.$f4608fdcfef13de69f10$.css rename to tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/async.$ae2da65b0213ce5b11bb$.css diff --git a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.$f4608fdcfef13de69f10$.css b/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.$ae2da65b0213ce5b11bb$.css similarity index 100% rename from tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.$f4608fdcfef13de69f10$.css rename to tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.$ae2da65b0213ce5b11bb$.css diff --git a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.js b/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.js index 7eea77a3c270..defe0c010ed0 100644 --- a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.js +++ b/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.js @@ -77,7 +77,7 @@ __webpack_require__.e = function (chunkId) { // webpack/runtime/get_full_hash (() => { __webpack_require__.h = function () { - return "f4608fdcfef13de69f10"; + return "ae2da65b0213ce5b11bb"; }; })(); @@ -177,30 +177,29 @@ __webpack_require__.r = function(exports) { })(); // webpack/runtime/auto_public_path (() => { +var scriptUrl; + +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} - var scriptUrl; - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } - } - } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl })(); // webpack/runtime/css loading (() => { diff --git a/tests/plugin-test/css-extract/cases/hmr-locals/expected/main.js b/tests/plugin-test/css-extract/cases/hmr-locals/expected/main.js index 68126974ad4d..d9930610a89b 100644 --- a/tests/plugin-test/css-extract/cases/hmr-locals/expected/main.js +++ b/tests/plugin-test/css-extract/cases/hmr-locals/expected/main.js @@ -811,30 +811,29 @@ __webpack_require__.r = function(exports) { })(); // webpack/runtime/auto_public_path (() => { +var scriptUrl; + +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} - var scriptUrl; - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } - } - } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl })(); // webpack/runtime/css loading (() => { diff --git a/tests/plugin-test/css-extract/cases/hmr/expected/main.js b/tests/plugin-test/css-extract/cases/hmr/expected/main.js index a5dcc4901c96..95f23f0ceb31 100644 --- a/tests/plugin-test/css-extract/cases/hmr/expected/main.js +++ b/tests/plugin-test/css-extract/cases/hmr/expected/main.js @@ -796,30 +796,29 @@ __webpack_require__.r = function(exports) { })(); // webpack/runtime/auto_public_path (() => { +var scriptUrl; + +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} - var scriptUrl; - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } - } - } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl })(); // webpack/runtime/css loading (() => { diff --git a/tests/plugin-test/css-extract/cases/insert-function/expected/main.js b/tests/plugin-test/css-extract/cases/insert-function/expected/main.js index fd661c44b7d5..0c8b241722d2 100644 --- a/tests/plugin-test/css-extract/cases/insert-function/expected/main.js +++ b/tests/plugin-test/css-extract/cases/insert-function/expected/main.js @@ -161,30 +161,29 @@ __webpack_require__.r = function(exports) { })(); // webpack/runtime/auto_public_path (() => { +var scriptUrl; - var scriptUrl; - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } - } - } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} + +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl })(); // webpack/runtime/css loading (() => { diff --git a/tests/plugin-test/css-extract/cases/insert-string/expected/main.js b/tests/plugin-test/css-extract/cases/insert-string/expected/main.js index 0c219fdf74e7..a8715c6a83fc 100644 --- a/tests/plugin-test/css-extract/cases/insert-string/expected/main.js +++ b/tests/plugin-test/css-extract/cases/insert-string/expected/main.js @@ -161,30 +161,29 @@ __webpack_require__.r = function(exports) { })(); // webpack/runtime/auto_public_path (() => { +var scriptUrl; - var scriptUrl; - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } - } - } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} + +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl })(); // webpack/runtime/css loading (() => { diff --git a/tests/plugin-test/css-extract/cases/insert-undefined/expected/main.js b/tests/plugin-test/css-extract/cases/insert-undefined/expected/main.js index 368cf43f95c6..2c8342a4f20b 100644 --- a/tests/plugin-test/css-extract/cases/insert-undefined/expected/main.js +++ b/tests/plugin-test/css-extract/cases/insert-undefined/expected/main.js @@ -161,30 +161,29 @@ __webpack_require__.r = function(exports) { })(); // webpack/runtime/auto_public_path (() => { +var scriptUrl; - var scriptUrl; - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } - } - } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} + +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl })(); // webpack/runtime/css loading (() => { diff --git a/tests/plugin-test/css-extract/cases/issue-6649/expected/main.js b/tests/plugin-test/css-extract/cases/issue-6649/expected/main.js index 90c18d1acb50..1b9332becbaa 100644 --- a/tests/plugin-test/css-extract/cases/issue-6649/expected/main.js +++ b/tests/plugin-test/css-extract/cases/issue-6649/expected/main.js @@ -1,434 +1,433 @@ (() => { // webpackBootstrap -var __webpack_modules__ = ({}); -/************************************************************************/ -// The module cache -var __webpack_module_cache__ = {}; - -// The require function -function __webpack_require__(moduleId) { - -// Check if module is in cache -var cachedModule = __webpack_module_cache__[moduleId]; -if (cachedModule !== undefined) { -return cachedModule.exports; -} -// Create a new module (and put it into the cache) -var module = (__webpack_module_cache__[moduleId] = { -exports: {} -}); -// Execute the module function -__webpack_modules__[moduleId](module, module.exports, __webpack_require__); - -// Return the exports of the module -return module.exports; - -} - -// expose the modules object (__webpack_modules__) -__webpack_require__.m = __webpack_modules__; - -/************************************************************************/ -// webpack/runtime/create_fake_namespace_object -(() => { -var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__ }; -var leafPrototypes; -// create a fake namespace object -// mode & 1: value is a module id, require it -// mode & 2: merge all properties of value into the ns -// mode & 4: return value when already ns object -// mode & 16: return value when it's Promise-like -// mode & 8|1: behave like require -__webpack_require__.t = function(value, mode) { - if(mode & 1) value = this(value); - if(mode & 8) return value; - if(typeof value === 'object' && value) { - if((mode & 4) && value.__esModule) return value; - if((mode & 16) && typeof value.then === 'function') return value; - } - var ns = Object.create(null); - __webpack_require__.r(ns); - var def = {}; - leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; - for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { - Object.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; } }); - } - def['default'] = function() { return value }; - __webpack_require__.d(ns, def); - return ns; -}; -})(); -// webpack/runtime/define_property_getters -(() => { -__webpack_require__.d = function(exports, definition) { - for(var key in definition) { - if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { - Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); - } - } -}; -})(); -// webpack/runtime/ensure_chunk -(() => { -__webpack_require__.f = {}; -// This file contains only the entry chunk. -// The chunk loading function for additional chunks -__webpack_require__.e = function (chunkId) { - return Promise.all( - Object.keys(__webpack_require__.f).reduce(function (promises, key) { - __webpack_require__.f[key](chunkId, promises); - return promises; - }, []) - ); -}; - -})(); -// webpack/runtime/get javascript chunk filename -(() => { -// This function allow to reference chunks - __webpack_require__.u = function (chunkId) { - // return url for filenames not based on template - - // return url for filenames based on template - return "" + chunkId + ".$" + {"\\css\\chunk": "b1b844425027e2012f17","\\js\\chunk": "033244835a8df445c8ec",}[chunkId] + "$.js"; - }; - -})(); -// webpack/runtime/get mini-css chunk filename -(() => { -// This function allow to reference chunks - __webpack_require__.miniCssF = function (chunkId) { - // return url for filenames not based on template - - // return url for filenames based on template - return "" + chunkId + ".$" + "2343dba8f37350b808da" + "$.css"; - }; - -})(); -// webpack/runtime/get_full_hash -(() => { -__webpack_require__.h = function () { - return "c7531e66fd9ba2e78281"; -}; - -})(); -// webpack/runtime/global -(() => { -__webpack_require__.g = (function () { - if (typeof globalThis === 'object') return globalThis; - try { - return this || new Function('return this')(); - } catch (e) { - if (typeof window === 'object') return window; - } -})(); - -})(); -// webpack/runtime/has_own_property -(() => { -__webpack_require__.o = function (obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -}; - -})(); -// webpack/runtime/load_script -(() => { -var inProgress = {}; - - -// loadScript function to load a script via script tag -__webpack_require__.l = function (url, done, key, chunkId) { - if (inProgress[url]) { - inProgress[url].push(done); - return; - } - var script, needAttach; - if (key !== undefined) { - var scripts = document.getElementsByTagName("script"); - for (var i = 0; i < scripts.length; i++) { - var s = scripts[i]; - if (s.getAttribute("src") == url) { - script = s; - break; - } - } - } - if (!script) { - needAttach = true; - - script = document.createElement('script'); - - script.charset = 'utf-8'; - script.timeout = 120; - if (__webpack_require__.nc) { - script.setAttribute("nonce", __webpack_require__.nc); - } - - - script.src = url; - - - } - inProgress[url] = [done]; - var onScriptComplete = function (prev, event) { - script.onerror = script.onload = null; - clearTimeout(timeout); - var doneFns = inProgress[url]; - delete inProgress[url]; - script.parentNode && script.parentNode.removeChild(script); - doneFns && - doneFns.forEach(function (fn) { - return fn(event); - }); - if (prev) return prev(event); - }; - var timeout = setTimeout( - onScriptComplete.bind(null, undefined, { - type: 'timeout', - target: script - }), - 120000 - ); - script.onerror = onScriptComplete.bind(null, script.onerror); - script.onload = onScriptComplete.bind(null, script.onload); - needAttach && document.head.appendChild(script); -}; - -})(); -// webpack/runtime/make_namespace_object -(() => { -// define __esModule on exports -__webpack_require__.r = function(exports) { - if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { - Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - } - Object.defineProperty(exports, '__esModule', { value: true }); -}; - -})(); -// webpack/runtime/auto_public_path -(() => { - - var scriptUrl; - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } - } - } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - -})(); -// webpack/runtime/css loading -(() => { -if (typeof document === "undefined") return; -var createStylesheet = function ( - chunkId, fullhref, oldTag, resolve, reject -) { - var linkTag = document.createElement("link"); - - linkTag.rel = "stylesheet"; - linkTag.type="text/css"; - if (__webpack_require__.nc) { - linkTag.nonce = __webpack_require__.nc; - } - var onLinkComplete = function (event) { - // avoid mem leaks. - linkTag.onerror = linkTag.onload = null; - if (event.type === 'load') { - resolve(); - } else { - var errorType = event && (event.type === 'load' ? 'missing' : event.type); - var realHref = event && event.target && event.target.href || fullhref; - var err = new Error("Loading CSS chunk " + chunkId + " failed.\\n(" + realHref + ")"); - err.code = "CSS_CHUNK_LOAD_FAILED"; - err.type = errorType; - err.request = realHref; - if (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag) - reject(err); + var __webpack_modules__ = ({}); + /************************************************************************/ + // The module cache + var __webpack_module_cache__ = {}; + + // The require function + function __webpack_require__(moduleId) { + + // Check if module is in cache + var cachedModule = __webpack_module_cache__[moduleId]; + if (cachedModule !== undefined) { + return cachedModule.exports; } - } + // Create a new module (and put it into the cache) + var module = (__webpack_module_cache__[moduleId] = { + exports: {} + }); + // Execute the module function + __webpack_modules__[moduleId](module, module.exports, __webpack_require__); - linkTag.onerror = linkTag.onload = onLinkComplete; - linkTag.href = fullhref; - - if (oldTag) { - oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling); -} else { - document.head.appendChild(linkTag); -} - return linkTag; -} -var findStylesheet = function (href, fullhref) { - var existingLinkTags = document.getElementsByTagName("link"); - for (var i = 0; i < existingLinkTags.length; i++) { - var tag = existingLinkTags[i]; - var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); - if (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag; - } + // Return the exports of the module + return module.exports; - var existingStyleTags = document.getElementsByTagName("style"); - for (var i = 0; i < existingStyleTags.length; i++) { - var tag = existingStyleTags[i]; - var dataHref = tag.getAttribute("data-href"); - if (dataHref === href || dataHref === fullhref) return tag; } -} - -var loadStylesheet = function (chunkId) { - return new Promise(function (resolve, reject) { - var href = __webpack_require__.miniCssF(chunkId); - var fullhref = __webpack_require__.p + href; - if (findStylesheet(href, fullhref)) return resolve(); - createStylesheet(chunkId, fullhref, null, resolve, reject); - }) -} - -// object to store loaded CSS chunks -var installedCssChunks = { - "\\entry\\name": 0, - -}; - -__webpack_require__.f.miniCss = function(chunkId, promises) { - var cssChunks = { -"\\css\\chunk": 1, - -}; - if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]) - else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) - promises.push( - installedCssChunks[chunkId] = loadStylesheet(chunkId).then( - function() { - installedCssChunks[chunkId] = 0; - }, - function(e) { - delete installedCssChunks[chunkId]; - throw e; + + // expose the modules object (__webpack_modules__) + __webpack_require__.m = __webpack_modules__; + + /************************************************************************/ + // webpack/runtime/create_fake_namespace_object + (() => { + var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); + var leafPrototypes; + // create a fake namespace object + // mode & 1: value is a module id, require it + // mode & 2: merge all properties of value into the ns + // mode & 4: return value when already ns object + // mode & 16: return value when it's Promise-like + // mode & 8|1: behave like require + __webpack_require__.t = function (value, mode) { + if (mode & 1) value = this(value); + if (mode & 8) return value; + if (typeof value === 'object' && value) { + if ((mode & 4) && value.__esModule) return value; + if ((mode & 16) && typeof value.then === 'function') return value; + } + var ns = Object.create(null); + __webpack_require__.r(ns); + var def = {}; + leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; + for (var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { + Object.getOwnPropertyNames(current).forEach((key) => { def[key] = () => (value[key]) }); + } + def['default'] = () => (value); + __webpack_require__.d(ns, def); + return ns; + }; + })(); + // webpack/runtime/define_property_getters + (() => { + __webpack_require__.d = function (exports, definition) { + for (var key in definition) { + if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { + Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); } - ) - ) -} - -// no hmr - -})(); -// webpack/runtime/jsonp_chunk_loading -(() => { - - // object to store loaded and loading chunks - // undefined = chunk not loaded, null = chunk preloaded/prefetched - // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded - var installedChunks = {"\\entry\\name": 0,}; - - __webpack_require__.f.j = function (chunkId, promises) { - // JSONP chunk loading for javascript -var installedChunkData = __webpack_require__.o(installedChunks, chunkId) - ? installedChunks[chunkId] - : undefined; -if (installedChunkData !== 0) { - // 0 means "already installed". - - // a Promise means "currently loading". - if (installedChunkData) { - promises.push(installedChunkData[2]); - } else { - if (true) { - // setup Promise in chunk cache - var promise = new Promise(function (resolve, reject) { - installedChunkData = installedChunks[chunkId] = [resolve, reject]; - }); - promises.push((installedChunkData[2] = promise)); - - // start chunk loading - var url = __webpack_require__.p + __webpack_require__.u(chunkId); - // create error before stack unwound to get useful stacktrace later - var error = new Error(); - var loadingEnded = function (event) { - if (__webpack_require__.o(installedChunks, chunkId)) { - installedChunkData = installedChunks[chunkId]; - if (installedChunkData !== 0) installedChunks[chunkId] = undefined; - if (installedChunkData) { - var errorType = - event && (event.type === 'load' ? 'missing' : event.type); - var realSrc = event && event.target && event.target.src; - error.message = - 'Loading chunk ' + - chunkId + - ' failed.\n(' + - errorType + - ': ' + - realSrc + - ')'; - error.name = 'ChunkLoadError'; - error.type = errorType; - error.request = realSrc; - installedChunkData[1](error); + } + }; + })(); + // webpack/runtime/ensure_chunk + (() => { + __webpack_require__.f = {}; + // This file contains only the entry chunk. + // The chunk loading function for additional chunks + __webpack_require__.e = function (chunkId) { + return Promise.all( + Object.keys(__webpack_require__.f).reduce(function (promises, key) { + __webpack_require__.f[key](chunkId, promises); + return promises; + }, []) + ); + }; + + })(); + // webpack/runtime/get javascript chunk filename + (() => { + // This function allow to reference chunks + __webpack_require__.u = function (chunkId) { + // return url for filenames not based on template + + // return url for filenames based on template + return "" + chunkId + ".$" + { "\\css\\chunk": "b1b844425027e2012f17", "\\js\\chunk": "033244835a8df445c8ec", }[chunkId] + "$.js"; + }; + + })(); + // webpack/runtime/get mini-css chunk filename + (() => { + // This function allow to reference chunks + __webpack_require__.miniCssF = function (chunkId) { + // return url for filenames not based on template + + // return url for filenames based on template + return "" + chunkId + ".$" + "2343dba8f37350b808da" + "$.css"; + }; + + })(); + // webpack/runtime/get_full_hash + (() => { + __webpack_require__.h = function () { + return "c7531e66fd9ba2e78281"; + }; + + })(); + // webpack/runtime/global + (() => { + __webpack_require__.g = (function () { + if (typeof globalThis === 'object') return globalThis; + try { + return this || new Function('return this')(); + } catch (e) { + if (typeof window === 'object') return window; + } + })(); + + })(); + // webpack/runtime/has_own_property + (() => { + __webpack_require__.o = function (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + }; + + })(); + // webpack/runtime/load_script + (() => { + var inProgress = {}; + + + // loadScript function to load a script via script tag + __webpack_require__.l = function (url, done, key, chunkId) { + if (inProgress[url]) { + inProgress[url].push(done); + return; + } + var script, needAttach; + if (key !== undefined) { + var scripts = document.getElementsByTagName("script"); + for (var i = 0; i < scripts.length; i++) { + var s = scripts[i]; + if (s.getAttribute("src") == url) { + script = s; + break; } } + } + if (!script) { + needAttach = true; + + script = document.createElement('script'); + + script.charset = 'utf-8'; + script.timeout = 120; + if (__webpack_require__.nc) { + script.setAttribute("nonce", __webpack_require__.nc); + } + + + script.src = url; + + + } + inProgress[url] = [done]; + var onScriptComplete = function (prev, event) { + script.onerror = script.onload = null; + clearTimeout(timeout); + var doneFns = inProgress[url]; + delete inProgress[url]; + script.parentNode && script.parentNode.removeChild(script); + doneFns && + doneFns.forEach(function (fn) { + return fn(event); + }); + if (prev) return prev(event); }; - __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); - } - } -} - - } - // install a JSONP callback for chunk loading -var webpackJsonpCallback = function (parentChunkLoadingFunction, data) { - var chunkIds = data[0]; - var moreModules = data[1]; - var runtime = data[2]; - // add "moreModules" to the modules object, - // then flag all "chunkIds" as loaded and fire callback - var moduleId, - chunkId, - i = 0; - if (chunkIds.some(function (id) { return installedChunks[id] !== 0 })) { - for (moduleId in moreModules) { - if (__webpack_require__.o(moreModules, moduleId)) { - __webpack_require__.m[moduleId] = moreModules[moduleId]; + var timeout = setTimeout( + onScriptComplete.bind(null, undefined, { + type: 'timeout', + target: script + }), + 120000 + ); + script.onerror = onScriptComplete.bind(null, script.onerror); + script.onload = onScriptComplete.bind(null, script.onload); + needAttach && document.head.appendChild(script); + }; + + })(); + // webpack/runtime/make_namespace_object + (() => { + // define __esModule on exports + __webpack_require__.r = function (exports) { + if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { + Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + } + Object.defineProperty(exports, '__esModule', { value: true }); + }; + + })(); + // webpack/runtime/auto_public_path + (() => { + var scriptUrl; + + if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; + var document = __webpack_require__.g.document; + if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } } } - if (runtime) var result = runtime(__webpack_require__); - } - if (parentChunkLoadingFunction) parentChunkLoadingFunction(data); - for (; i < chunkIds.length; i++) { - chunkId = chunkIds[i]; - if ( - __webpack_require__.o(installedChunks, chunkId) && - installedChunks[chunkId] + + // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", + // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', + if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); + scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); + __webpack_require__.p = scriptUrl + })(); + // webpack/runtime/css loading + (() => { + if (typeof document === "undefined") return; + var createStylesheet = function ( + chunkId, fullhref, oldTag, resolve, reject ) { - installedChunks[chunkId][0](); + var linkTag = document.createElement("link"); + + linkTag.rel = "stylesheet"; + linkTag.type = "text/css"; + if (__webpack_require__.nc) { + linkTag.nonce = __webpack_require__.nc; + } + var onLinkComplete = function (event) { + // avoid mem leaks. + linkTag.onerror = linkTag.onload = null; + if (event.type === 'load') { + resolve(); + } else { + var errorType = event && (event.type === 'load' ? 'missing' : event.type); + var realHref = event && event.target && event.target.href || fullhref; + var err = new Error("Loading CSS chunk " + chunkId + " failed.\\n(" + realHref + ")"); + err.code = "CSS_CHUNK_LOAD_FAILED"; + err.type = errorType; + err.request = realHref; + if (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag) + reject(err); + } + } + + linkTag.onerror = linkTag.onload = onLinkComplete; + linkTag.href = fullhref; + + if (oldTag) { + oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling); + } else { + document.head.appendChild(linkTag); + } + return linkTag; } - installedChunks[chunkId] = 0; - } - -}; + var findStylesheet = function (href, fullhref) { + var existingLinkTags = document.getElementsByTagName("link"); + for (var i = 0; i < existingLinkTags.length; i++) { + var tag = existingLinkTags[i]; + var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); + if (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag; + } + + var existingStyleTags = document.getElementsByTagName("style"); + for (var i = 0; i < existingStyleTags.length; i++) { + var tag = existingStyleTags[i]; + var dataHref = tag.getAttribute("data-href"); + if (dataHref === href || dataHref === fullhref) return tag; + } + } + + var loadStylesheet = function (chunkId) { + return new Promise(function (resolve, reject) { + var href = __webpack_require__.miniCssF(chunkId); + var fullhref = __webpack_require__.p + href; + if (findStylesheet(href, fullhref)) return resolve(); + createStylesheet(chunkId, fullhref, null, resolve, reject); + }) + } + + // object to store loaded CSS chunks + var installedCssChunks = { + "\\entry\\name": 0, + + }; + + __webpack_require__.f.miniCss = function (chunkId, promises) { + var cssChunks = { + "\\css\\chunk": 1, + + }; + if (installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]) + else if (installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) + promises.push( + installedCssChunks[chunkId] = loadStylesheet(chunkId).then( + function () { + installedCssChunks[chunkId] = 0; + }, + function (e) { + delete installedCssChunks[chunkId]; + throw e; + } + ) + ) + } + + // no hmr + + })(); + // webpack/runtime/jsonp_chunk_loading + (() => { + + // object to store loaded and loading chunks + // undefined = chunk not loaded, null = chunk preloaded/prefetched + // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded + var installedChunks = { "\\entry\\name": 0, }; + + __webpack_require__.f.j = function (chunkId, promises) { + // JSONP chunk loading for javascript + var installedChunkData = __webpack_require__.o(installedChunks, chunkId) + ? installedChunks[chunkId] + : undefined; + if (installedChunkData !== 0) { + // 0 means "already installed". + + // a Promise means "currently loading". + if (installedChunkData) { + promises.push(installedChunkData[2]); + } else { + if (true) { + // setup Promise in chunk cache + var promise = new Promise(function (resolve, reject) { + installedChunkData = installedChunks[chunkId] = [resolve, reject]; + }); + promises.push((installedChunkData[2] = promise)); + + // start chunk loading + var url = __webpack_require__.p + __webpack_require__.u(chunkId); + // create error before stack unwound to get useful stacktrace later + var error = new Error(); + var loadingEnded = function (event) { + if (__webpack_require__.o(installedChunks, chunkId)) { + installedChunkData = installedChunks[chunkId]; + if (installedChunkData !== 0) installedChunks[chunkId] = undefined; + if (installedChunkData) { + var errorType = + event && (event.type === 'load' ? 'missing' : event.type); + var realSrc = event && event.target && event.target.src; + error.message = + 'Loading chunk ' + + chunkId + + ' failed.\n(' + + errorType + + ': ' + + realSrc + + ')'; + error.name = 'ChunkLoadError'; + error.type = errorType; + error.request = realSrc; + installedChunkData[1](error); + } + } + }; + __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); + } + } + } + + } + // install a JSONP callback for chunk loading + var webpackJsonpCallback = function (parentChunkLoadingFunction, data) { + var chunkIds = data[0]; + var moreModules = data[1]; + var runtime = data[2]; + // add "moreModules" to the modules object, + // then flag all "chunkIds" as loaded and fire callback + var moduleId, + chunkId, + i = 0; + if (chunkIds.some(function (id) { return installedChunks[id] !== 0 })) { + for (moduleId in moreModules) { + if (__webpack_require__.o(moreModules, moduleId)) { + __webpack_require__.m[moduleId] = moreModules[moduleId]; + } + } + if (runtime) var result = runtime(__webpack_require__); + } + if (parentChunkLoadingFunction) parentChunkLoadingFunction(data); + for (; i < chunkIds.length; i++) { + chunkId = chunkIds[i]; + if ( + __webpack_require__.o(installedChunks, chunkId) && + installedChunks[chunkId] + ) { + installedChunks[chunkId][0](); + } + installedChunks[chunkId] = 0; + } + + }; -var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; -chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); -chunkLoadingGlobal.push = webpackJsonpCallback.bind( - null, - chunkLoadingGlobal.push.bind(chunkLoadingGlobal) -); + var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; + chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); + chunkLoadingGlobal.push = webpackJsonpCallback.bind( + null, + chunkLoadingGlobal.push.bind(chunkLoadingGlobal) + ); -})(); -/************************************************************************/ -var __webpack_exports__ = {}; -__webpack_require__.e(/* import() | \js\chunk */ "\\js\\chunk").then(__webpack_require__.t.bind(__webpack_require__, "./src/chunk.js", 23)); + })(); + /************************************************************************/ + var __webpack_exports__ = {}; + __webpack_require__.e(/* import() | \js\chunk */ "\\js\\chunk").then(__webpack_require__.t.bind(__webpack_require__, "./src/chunk.js", 23)); })() -; \ No newline at end of file + ; diff --git a/tests/plugin-test/css-extract/cases/no-runtime/expected/main.js b/tests/plugin-test/css-extract/cases/no-runtime/expected/main.js index 5dec33303d7d..ff06b9c39fa0 100644 --- a/tests/plugin-test/css-extract/cases/no-runtime/expected/main.js +++ b/tests/plugin-test/css-extract/cases/no-runtime/expected/main.js @@ -159,30 +159,29 @@ __webpack_require__.r = function(exports) { })(); // webpack/runtime/auto_public_path (() => { +var scriptUrl; - var scriptUrl; - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } - } - } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} + +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl })(); // webpack/runtime/jsonp_chunk_loading (() => { diff --git a/tests/plugin-test/css-extract/cases/runtime/expected/runtime~main.js b/tests/plugin-test/css-extract/cases/runtime/expected/runtime~main.js index 3f4afe80dab8..f6f72590ba28 100644 --- a/tests/plugin-test/css-extract/cases/runtime/expected/runtime~main.js +++ b/tests/plugin-test/css-extract/cases/runtime/expected/runtime~main.js @@ -31,7 +31,7 @@ __webpack_require__.m = __webpack_modules__; /************************************************************************/ // webpack/runtime/create_fake_namespace_object (() => { -var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__ }; +var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); var leafPrototypes; // create a fake namespace object // mode & 1: value is a module id, require it @@ -51,9 +51,9 @@ __webpack_require__.t = function(value, mode) { var def = {}; leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { - Object.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; } }); + Object.getOwnPropertyNames(current).forEach((key) => { def[key] = () => (value[key]) }); } - def['default'] = function() { return value }; + def['default'] = () => (value); __webpack_require__.d(ns, def); return ns; }; @@ -241,30 +241,29 @@ __webpack_require__.O = function (result, chunkIds, fn, priority) { })(); // webpack/runtime/auto_public_path (() => { +var scriptUrl; - var scriptUrl; - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } - } - } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} + +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl })(); // webpack/runtime/jsonp_chunk_loading (() => { diff --git a/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap b/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap index 24cede329d22..92e89e50b4fb 100644 --- a/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap +++ b/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap @@ -4,7 +4,7 @@ exports[`StatsTestCases should print correct stats for asset 1`] = ` "asset c560fa876f51d750.png 14.6 KiB [emitted] [immutable] [from: images/file.png] (auxiliary name: main) asset bundle.js 13.1 KiB [emitted] (name: main) asset static/file.html 12 bytes [emitted] [from: static/file.html] (auxiliary name: main) -runtime modules 1.61 KiB 2 modules +runtime modules 1.5 KiB 2 modules modules by path ./ 9.34 KiB (javascript) 14.6 KiB (asset) modules by path ./images/ 8.86 KiB (javascript) 14.6 KiB (asset) ./images/file.png 42 bytes (javascript) 14.6 KiB (asset) [built] [code generated] @@ -27,7 +27,7 @@ exports[`StatsTestCases should print correct stats for asset-concat 1`] = ` asset bundle.js 12.3 KiB [emitted] (name: main) asset static/file.html 12 bytes [emitted] [from: static/file.html] (auxiliary name: main) orphan modules 9.43 KiB [orphan] 8 modules -runtime modules 1.61 KiB 2 modules +runtime modules 1.5 KiB 2 modules cacheable modules 9.59 KiB (javascript) 14.6 KiB (asset) ./index.js + 9 modules 9.51 KiB [code generated] ./images/file.png 42 bytes (javascript) 14.6 KiB (asset) [built] [code generated] @@ -125,7 +125,7 @@ default: > ./c c dependent modules 80 bytes [dependent] 4 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 7.38 KiB (runtime) [entry] [rendered] + chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] chunk (runtime: a, main) default/async-g.js (async-g) 45 bytes [rendered] @@ -169,7 +169,7 @@ vendors: > ./c c dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) vendors/main.js (main) 147 bytes (javascript) 7.36 KiB (runtime) [entry] [rendered] + chunk (runtime: main) vendors/main.js (main) 147 bytes (javascript) 7.25 KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] chunk (runtime: a, main) vendors/async-g.js (async-g) 65 bytes [rendered] @@ -257,7 +257,7 @@ all: chunk (runtime: b) all/726.js (id hint: vendors) 116 bytes [initial] [rendered] split chunk (cache group: vendors) > ./b b ./b.js 116 bytes [built] [code generated] - chunk (runtime: a) all/a.js (a) 8.37 KiB [entry] [rendered] + chunk (runtime: a) all/a.js (a) 8.26 KiB [entry] [rendered] > ./a a chunk (runtime: b) all/b.js (b) 2.86 KiB [entry] [rendered] > ./b b @@ -266,7 +266,7 @@ all: chunk (runtime: a, main) all/889.js (id hint: vendors) 45 bytes [rendered] split chunk (cache group: vendors) > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) all/main.js (main) 8.37 KiB [entry] [rendered] + chunk (runtime: main) all/main.js (main) 8.26 KiB [entry] [rendered] > ./ main chunk (runtime: main) all/910.js (id hint: vendors) 165 bytes [rendered] split chunk (cache group: vendors) > ./a ./index.js 1:0-47 @@ -294,7 +294,7 @@ chunk (runtime: main) 751.bundle.js (b) 49 bytes <{76}> <{909}> >{76}< [rendered ./module-b.js 49 bytes [built] [code generated] chunk (runtime: main) 76.bundle.js (c) 98 bytes <{74}> <{751}> >{74}< >{751}< [rendered] ./module-c.js 98 bytes [built] [code generated] -chunk (runtime: main) bundle.js (main) 98 bytes (javascript) 8.46 KiB (runtime) >{74}< >{751}< [entry] [rendered] +chunk (runtime: main) bundle.js (main) 98 bytes (javascript) 8.29 KiB (runtime) >{74}< >{751}< [entry] [rendered] ./index.js 98 bytes [built] [code generated] Rspack x.x.x compiled successfully" `; @@ -399,7 +399,7 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for graph-correctness-entries 1`] = ` -"chunk (runtime: e1) e1.js (e1) 49 bytes (javascript) 8.49 KiB (runtime) >{74}< [entry] [rendered] +"chunk (runtime: e1) e1.js (e1) 49 bytes (javascript) 8.32 KiB (runtime) >{74}< [entry] [rendered] ./e1.js 49 bytes [built] [code generated] entry ./e1 chunk (runtime: e1, e2) a.js (a) 49 bytes <{605}> <{76}> >{751}< [rendered] @@ -413,14 +413,14 @@ chunk (runtime: e1, e2) c.js (c) 49 bytes <{751}> <{844}> >{74}< [rendered] ./module-c.js 49 bytes [built] [code generated] import() ./module-c ./e2.js import() ./module-c ./module-b.js -chunk (runtime: e2) e2.js (e2) 49 bytes (javascript) 8.49 KiB (runtime) >{76}< [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 49 bytes (javascript) 8.32 KiB (runtime) >{76}< [entry] [rendered] ./e2.js 49 bytes [built] [code generated] entry ./e2 Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for graph-correctness-modules 1`] = ` -"chunk (runtime: e1) e1.js (e1) 119 bytes (javascript) 8.8 KiB (runtime) >{74}< >{984}< [entry] [rendered] +"chunk (runtime: e1) e1.js (e1) 119 bytes (javascript) 8.63 KiB (runtime) >{74}< >{984}< [entry] [rendered] ./e1.js 70 bytes [built] [code generated] entry ./e1 ./module-x.js 49 bytes [dependent] [built] [code generated] @@ -438,7 +438,7 @@ chunk (runtime: e1, e2) c.js (c) 49 bytes <{751}> <{844}> >{74}< [rendered] ./module-c.js 49 bytes [built] [code generated] import() ./module-c ./e2.js import() ./module-c ./module-b.js -chunk (runtime: e2) e2.js (e2) 119 bytes (javascript) 8.8 KiB (runtime) >{76}< >{984}< [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 119 bytes (javascript) 8.63 KiB (runtime) >{76}< >{984}< [entry] [rendered] ./e2.js 70 bytes [built] [code generated] entry ./e2 ./module-x.js 49 bytes [dependent] [built] [code generated] @@ -477,7 +477,7 @@ chunk (runtime: main) id-equals-name_js0.js 21 bytes [rendered] ./id-equals-name.js 21 bytes [built] [code generated] chunk (runtime: main) id-equals-name_js_3.js 21 bytes [rendered] ./id-equals-name.js?3 21 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 639 bytes (javascript) 7.28 KiB (runtime) [entry] [rendered] +chunk (runtime: main) main.js (main) 639 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] ./index.js 639 bytes [built] [code generated] chunk (runtime: main) tree.js (tree) 137 bytes [rendered] dependent modules 98 bytes [dependent] 3 modules @@ -542,7 +542,7 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for import-with-invalid-options-comments 1`] = ` -"runtime modules 9.51 KiB 12 modules +"runtime modules 9.33 KiB 12 modules cacheable modules 559 bytes ./index.js 50 bytes [built] [code generated] ./chunk.js 401 bytes [built] [code generated] [2 warnings] @@ -637,7 +637,7 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin ./a.js 22 bytes [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle2.js (main) 101 bytes (javascript) 8.46 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle2.js (main) 101 bytes (javascript) 8.29 KiB (runtime) >{76}< [entry] [rendered] ./index.js 101 bytes [built] [code generated] 2 chunks (Rspack x.x.x) compiled successfully in X.23 @@ -652,7 +652,7 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin ./e.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle3.js (c) 30 bytes <{909}> >{656}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle3.js (main) 101 bytes (javascript) 8.46 KiB (runtime) >{656}< >{76}< [entry] [rendered] + chunk (runtime: main) bundle3.js (main) 101 bytes (javascript) 8.29 KiB (runtime) >{656}< >{76}< [entry] [rendered] ./index.js 101 bytes [built] [code generated] 3 chunks (Rspack x.x.x) compiled successfully in X.23 @@ -669,7 +669,7 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin ./e.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle4.js (c) 30 bytes <{909}> >{537}< >{697}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle4.js (main) 101 bytes (javascript) 8.46 KiB (runtime) >{537}< >{76}< [entry] [rendered] + chunk (runtime: main) bundle4.js (main) 101 bytes (javascript) 8.29 KiB (runtime) >{537}< >{76}< [entry] [rendered] ./index.js 101 bytes [built] [code generated] 4 chunks (Rspack x.x.x) compiled successfully in X.23" `; @@ -741,9 +741,9 @@ chunk (runtime: main) a.js (a) 36 bytes [rendered] ./node_modules/a/index.js 36 bytes [built] [code generated] chunk (runtime: main) b.js (b) 18 bytes [rendered] ./node_modules/b/index.js 18 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 82 bytes (javascript) 7.02 KiB (runtime) [entry] [rendered] +chunk (runtime: main) main.js (main) 82 bytes (javascript) 6.91 KiB (runtime) [entry] [rendered] ./index.js 82 bytes [built] [code generated] -runtime modules 7.02 KiB 8 modules +runtime modules 6.91 KiB 8 modules orphan modules 98 bytes [orphan] 2 modules modules with assets 136 bytes ./index.js 82 bytes [built] [code generated] @@ -772,20 +772,20 @@ chunk (runtime: e3) 400.js 61 bytes [rendered] chunk (runtime: e1, e3) 511.js 81 bytes [rendered] ./async2.js 61 bytes [built] [code generated] ./f.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e1) e1.js (e1) 249 bytes (javascript) 7.28 KiB (runtime) [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 249 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] ./e1.js + 2 modules 209 bytes [code generated] chunk (runtime: e2, e3) 637.js 81 bytes [rendered] ./async1.js 61 bytes [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e3) e3.js (e3) 249 bytes (javascript) 7.28 KiB (runtime) [entry] [rendered] +chunk (runtime: e3) e3.js (e3) 249 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./e3.js + 2 modules 209 bytes [code generated] ./h.js 20 bytes [dependent] [built] [code generated] chunk (runtime: e2) 806.js 61 bytes [rendered] ./async2.js 61 bytes [built] [code generated] -chunk (runtime: e2) e2.js (e2) 249 bytes (javascript) 7.28 KiB (runtime) [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 249 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./e2.js + 2 modules 209 bytes [code generated] ./f.js 20 bytes [dependent] [built] [code generated] @@ -802,7 +802,7 @@ asset async3.js 860 bytes [emitted] (name: async3) chunk (runtime: e1, e2, e3) async3.js (async3) 135 bytes [rendered] ./async3.js 115 bytes [built] [code generated] ./h.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e1) e1.js (e1) 242 bytes (javascript) 7.33 KiB (runtime) [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 242 bytes (javascript) 7.22 KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] ./e1.js + 2 modules 202 bytes [code generated] @@ -812,11 +812,11 @@ chunk (runtime: e1, e2, e3) async2.js (async2) 135 bytes [rendered] chunk (runtime: e1, e2, e3) async1.js (async1) 135 bytes [rendered] ./async1.js 115 bytes [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e3) e3.js (e3) 242 bytes (javascript) 7.33 KiB (runtime) [entry] [rendered] +chunk (runtime: e3) e3.js (e3) 242 bytes (javascript) 7.22 KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./e3.js + 2 modules 202 bytes [code generated] ./h.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e2) e2.js (e2) 242 bytes (javascript) 7.33 KiB (runtime) [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 242 bytes (javascript) 7.22 KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./e2.js + 2 modules 202 bytes [code generated] ./f.js 20 bytes [dependent] [built] [code generated] @@ -947,7 +947,7 @@ chunk (runtime: main) a-727.js (id hint: ) 149 bytes [rendered] split chunk (cac > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./shared.js 149 bytes [built] [code generated] -chunk (runtime: main) a-main.js (main) 146 bytes (javascript) 7.66 KiB (runtime) [entry] [rendered] +chunk (runtime: main) a-main.js (main) 146 bytes (javascript) 7.55 KiB (runtime) [entry] [rendered] > ./ main ./index.js 146 bytes [built] [code generated] Rspack x.x.x compiled successfully @@ -973,7 +973,7 @@ chunk (runtime: main) b-727.js (id hint: ) 149 bytes [rendered] split chunk (cac > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./shared.js 149 bytes [built] [code generated] -chunk (runtime: main) b-main.js (main) 146 bytes (javascript) 7.66 KiB (runtime) [entry] [rendered] +chunk (runtime: main) b-main.js (main) 146 bytes (javascript) 7.55 KiB (runtime) [entry] [rendered] > ./ main ./index.js 146 bytes [built] [code generated] Rspack x.x.x compiled successfully" @@ -1025,7 +1025,7 @@ chunk {405} (runtime: main) ac in ab.js (ac in ab) 2 bytes <{909}> [rendered] chunk {787} (runtime: main) cir2.js (cir2) 81 bytes <{909}> >{228}< [rendered] > [10] ./index.js 14:0-54 ./circular2.js [193] 81 bytes {334} {787} [built] [code generated] -chunk {909} (runtime: main) main.js (main) 524 bytes (javascript) 6.83 KiB (runtime) >{228}< >{295}< >{37}< >{405}< >{787}< >{919}< [entry] [rendered] +chunk {909} (runtime: main) main.js (main) 524 bytes (javascript) 6.72 KiB (runtime) >{228}< >{295}< >{37}< >{405}< >{787}< >{919}< [entry] [rendered] > ./index main ./index.js [10] 523 bytes {909} [built] [code generated] ./modules/f.js [544] 1 bytes {909} [dependent] [built] [code generated] @@ -1218,7 +1218,7 @@ chunk {481} (runtime: main) inner.js (inner) 1 bytes <{674}> [rendered] chunk {615} (runtime: main) normal.js (normal) 1 bytes <{909}> [rendered] chunk {674} (runtime: main) prefetched.js (prefetched) 228 bytes <{909}> >{481}< >{857}< (prefetch: {857} {481}) [rendered] chunk {857} (runtime: main) inner2.js (inner2) 2 bytes <{674}> [rendered] -chunk {909} (runtime: main) main.js (main) 436 bytes (javascript) 11 KiB (runtime) >{182}< >{424}< >{615}< >{674}< (prefetch: {674} {182} {424}) [entry] [rendered]" +chunk {909} (runtime: main) main.js (main) 436 bytes (javascript) 10.8 KiB (runtime) >{182}< >{424}< >{615}< >{674}< (prefetch: {674} {182} {424}) [entry] [rendered]" `; exports[`StatsTestCases should print correct stats for prefetch-preload-mixed 1`] = ` @@ -1232,7 +1232,7 @@ chunk (runtime: main) a2.js (a2) 1 bytes <{74}> [rendered] chunk (runtime: main) b.js (b) 203 bytes <{909}> >{438}< >{439}< >{826}< (prefetch: {826} {438}) (preload: {439}) [rendered] chunk (runtime: main) c.js (c) 134 bytes <{909}> >{380}< >{433}< (preload: {433} {380}) [rendered] chunk (runtime: main) b1.js (b1) 1 bytes <{751}> [rendered] -chunk (runtime: main) main.js (main) 195 bytes (javascript) 11.7 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered]" +chunk (runtime: main) main.js (main) 195 bytes (javascript) 11.5 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered]" `; exports[`StatsTestCases should print correct stats for preload 1`] = ` @@ -1251,7 +1251,7 @@ chunk (runtime: main) preloaded3.js (preloaded3) 1 bytes [rendered] chunk (runtime: main) preloaded2.js (preloaded2) 1 bytes [rendered] chunk (runtime: main) normal.js (normal) 1 bytes [rendered] chunk (runtime: main) inner2.js (inner2) 2 bytes [rendered] -chunk (runtime: main) main.js (main) 424 bytes (javascript) 9.81 KiB (runtime) (preload: {154} {551} {577}) [entry] [rendered]" +chunk (runtime: main) main.js (main) 424 bytes (javascript) 9.62 KiB (runtime) (preload: {154} {551} {577}) [entry] [rendered]" `; exports[`StatsTestCases should print correct stats for preset-errors-only 1`] = `""`; @@ -1321,61 +1321,61 @@ Rspack x.x.x compiled successfully" exports[`StatsTestCases should print correct stats for related-assets 1`] = ` "default: - assets by path *.br 14 KiB - asset default-main.js.br 12 KiB [emitted] - asset default-main.js.map.br 676 bytes [emitted] + assets by path *.br 13.9 KiB + asset default-main.js.br 11.9 KiB [emitted] + asset default-main.js.map.br 675 bytes [emitted] + 6 assets - assets by path *.gz 14 KiB - asset default-main.js.gz 12 KiB [emitted] - asset default-main.js.map.gz 676 bytes [emitted] + assets by path *.gz 13.9 KiB + asset default-main.js.gz 11.9 KiB [emitted] + asset default-main.js.map.gz 675 bytes [emitted] asset default-chunk_js.js.gz 611 bytes [emitted] + 5 assets - assets by path *.js 12.6 KiB - asset default-main.js 12 KiB [emitted] (name: main) + assets by path *.js 12.5 KiB + asset default-main.js 11.9 KiB [emitted] (name: main) asset default-chunk_js.js 611 bytes [emitted] assets by path *.css 142 bytes asset default-chunk_js.css 73 bytes [emitted] asset default-main.css 69 bytes [emitted] (name: main) relatedAssets: - assets by path *.br 14.1 KiB - asset relatedAssets-main.js.br 12 KiB [emitted] - asset relatedAssets-main.js.map.br 682 bytes [emitted] + assets by path *.br 13.9 KiB + asset relatedAssets-main.js.br 11.9 KiB [emitted] + asset relatedAssets-main.js.map.br 681 bytes [emitted] + 6 assets - assets by path *.gz 14.1 KiB - asset relatedAssets-main.js.gz 12 KiB [emitted] - asset relatedAssets-main.js.map.gz 682 bytes [emitted] + assets by path *.gz 13.9 KiB + asset relatedAssets-main.js.gz 11.9 KiB [emitted] + asset relatedAssets-main.js.map.gz 681 bytes [emitted] asset relatedAssets-chunk_js.js.gz 617 bytes [emitted] + 5 assets - assets by path *.js 12.6 KiB - asset relatedAssets-main.js 12 KiB [emitted] (name: main) + assets by path *.js 12.5 KiB + asset relatedAssets-main.js 11.9 KiB [emitted] (name: main) asset relatedAssets-chunk_js.js 617 bytes [emitted] assets by path *.css 154 bytes asset relatedAssets-chunk_js.css 79 bytes [emitted] asset relatedAssets-main.css 75 bytes [emitted] (name: main) exclude1: - hidden assets 28 KiB 16 assets - assets by status 12.7 KiB [emitted] - assets by path *.js 12.6 KiB - asset exclude1-main.js 12 KiB [emitted] (name: main) + hidden assets 27.8 KiB 16 assets + assets by status 12.6 KiB [emitted] + assets by path *.js 12.5 KiB + asset exclude1-main.js 11.9 KiB [emitted] (name: main) asset exclude1-chunk_js.js 612 bytes [emitted] assets by path *.css 144 bytes asset exclude1-chunk_js.css 74 bytes [emitted] asset exclude1-main.css 70 bytes [emitted] (name: main) exclude2: - assets by path *.br 14 KiB - asset exclude2-main.js.br 12 KiB [emitted] - asset exclude2-main.js.map.br 677 bytes [emitted] + assets by path *.br 13.9 KiB + asset exclude2-main.js.br 11.9 KiB [emitted] + asset exclude2-main.js.map.br 676 bytes [emitted] + 6 assets - assets by path *.gz 14 KiB - asset exclude2-main.js.gz 12 KiB [emitted] - asset exclude2-main.js.map.gz 677 bytes [emitted] + assets by path *.gz 13.9 KiB + asset exclude2-main.js.gz 11.9 KiB [emitted] + asset exclude2-main.js.map.gz 676 bytes [emitted] asset exclude2-chunk_js.js.gz 612 bytes [emitted] + 5 assets - assets by path *.js 12.6 KiB - asset exclude2-main.js 12 KiB [emitted] (name: main) + assets by path *.js 12.5 KiB + asset exclude2-main.js 11.9 KiB [emitted] (name: main) asset exclude2-chunk_js.js 612 bytes [emitted] assets by path *.css 144 bytes asset exclude2-chunk_js.css 74 bytes [emitted] @@ -1383,19 +1383,19 @@ exclude2: exclude3: hidden assets 2.89 KiB 10 assets - assets by status 37.9 KiB [emitted] - assets by path *.br 12.9 KiB - asset exclude3-main.js.br 12 KiB [emitted] - asset exclude3-main.js.map.br 677 bytes [emitted] + assets by status 37.5 KiB [emitted] + assets by path *.br 12.8 KiB + asset exclude3-main.js.br 11.9 KiB [emitted] + asset exclude3-main.js.map.br 676 bytes [emitted] asset exclude3-main.css.map.br 171 bytes [emitted] asset exclude3-main.css.br 70 bytes [emitted] - assets by path *.gz 12.9 KiB - asset exclude3-main.js.gz 12 KiB [emitted] - asset exclude3-main.js.map.gz 677 bytes [emitted] + assets by path *.gz 12.8 KiB + asset exclude3-main.js.gz 11.9 KiB [emitted] + asset exclude3-main.js.map.gz 676 bytes [emitted] asset exclude3-main.css.map.gz 171 bytes [emitted] asset exclude3-main.css.gz 70 bytes [emitted] - assets by chunk 12.1 KiB (name: main) - asset exclude3-main.js 12 KiB [emitted] (name: main) + assets by chunk 12 KiB (name: main) + asset exclude3-main.js 11.9 KiB [emitted] (name: main) asset exclude3-main.css 70 bytes [emitted] (name: main)" `; @@ -1463,7 +1463,7 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp asset production-dy_js.js 827 bytes [emitted] asset production-dz_js.js 827 bytes [emitted] asset production-c.js 45 bytes [emitted] (name: c) - chunk (runtime: a) production-a.js (a) 605 bytes (javascript) 7.29 KiB (runtime) [entry] [rendered] + chunk (runtime: a) production-a.js (a) 605 bytes (javascript) 7.18 KiB (runtime) [entry] [rendered] ./a.js 261 bytes [built] [code generated] [no exports used] ./dx-importer.js 63 bytes [dependent] [built] [code generated] @@ -1474,7 +1474,7 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp [only some exports used: x, y] ./reexport.js 37 bytes [dependent] [built] [code generated] [only some exports used: x, y] - chunk (runtime: b) production-b.js (b) 605 bytes (javascript) 7.29 KiB (runtime) [entry] [rendered] + chunk (runtime: b) production-b.js (b) 605 bytes (javascript) 7.18 KiB (runtime) [entry] [rendered] ./b.js 261 bytes [built] [code generated] [no exports used] ./dx-importer.js 63 bytes [dependent] [built] [code generated] @@ -1508,7 +1508,7 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp ./dz.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - runtime modules 14.6 KiB 18 modules + runtime modules 14.4 KiB 18 modules cacheable modules 1.15 KiB ./a.js 261 bytes [built] [code generated] [no exports used] @@ -1533,14 +1533,14 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp production (Rspack x.x.x) compiled successfully in X.23 development: - asset development-a.js 12.1 KiB [emitted] (name: a) - asset development-b.js 12.1 KiB [emitted] (name: b) + asset development-a.js 12 KiB [emitted] (name: a) + asset development-b.js 12 KiB [emitted] (name: b) asset development-dw_js.js 1.07 KiB [emitted] asset development-dx_js.js 1.07 KiB [emitted] asset development-dy_js.js 1.07 KiB [emitted] asset development-dz_js.js 1.07 KiB [emitted] asset development-c.js 419 bytes [emitted] (name: c) - chunk (runtime: a) development-a.js (a) 605 bytes (javascript) 7.29 KiB (runtime) [entry] [rendered] + chunk (runtime: a) development-a.js (a) 605 bytes (javascript) 7.18 KiB (runtime) [entry] [rendered] ./a.js 261 bytes [built] [code generated] [used exports unknown] ./dx-importer.js 63 bytes [dependent] [built] [code generated] @@ -1551,7 +1551,7 @@ development: [used exports unknown] ./reexport.js 37 bytes [dependent] [built] [code generated] [used exports unknown] - chunk (runtime: b) development-b.js (b) 605 bytes (javascript) 7.29 KiB (runtime) [entry] [rendered] + chunk (runtime: b) development-b.js (b) 605 bytes (javascript) 7.18 KiB (runtime) [entry] [rendered] ./b.js 261 bytes [built] [code generated] [used exports unknown] ./dx-importer.js 63 bytes [dependent] [built] [code generated] @@ -1585,7 +1585,7 @@ development: [used exports unknown] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [used exports unknown] - runtime modules 14.6 KiB 18 modules + runtime modules 14.4 KiB 18 modules cacheable modules 1.15 KiB ./a.js 261 bytes [built] [code generated] [used exports unknown] @@ -1621,7 +1621,7 @@ global: asset global-dy_js.js 843 bytes [emitted] asset global-dz_js.js 843 bytes [emitted] asset global-c.js 45 bytes [emitted] (name: c) - chunk (runtime: a) global-a.js (a) 605 bytes (javascript) 7.28 KiB (runtime) [entry] [rendered] + chunk (runtime: a) global-a.js (a) 605 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] ./a.js 261 bytes [built] [code generated] [no exports used] ./dx-importer.js 63 bytes [dependent] [built] [code generated] @@ -1632,7 +1632,7 @@ global: [only some exports used: x, y] ./reexport.js 37 bytes [dependent] [built] [code generated] [only some exports used: x, y] - chunk (runtime: b) global-b.js (b) 605 bytes (javascript) 7.28 KiB (runtime) [entry] [rendered] + chunk (runtime: b) global-b.js (b) 605 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] ./b.js 261 bytes [built] [code generated] [no exports used] ./dx-importer.js 63 bytes [dependent] [built] [code generated] @@ -1662,7 +1662,7 @@ global: ./dz.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - runtime modules 14.6 KiB 18 modules + runtime modules 14.3 KiB 18 modules cacheable modules 1.15 KiB ./a.js 261 bytes [built] [code generated] [no exports used] @@ -1688,7 +1688,7 @@ global: `; exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = ` -"runtime modules 14.6 KiB 18 modules +"runtime modules 14.4 KiB 18 modules orphan modules 118 bytes [orphan] 4 modules cacheable modules 726 bytes ./first.js 236 bytes [built] [code generated] @@ -1700,7 +1700,7 @@ cacheable modules 726 bytes ./common_lazy_shared.js 25 bytes [built] [code generated] Rspack x.x.x compiled successfully in X.23 -runtime modules 14.6 KiB 18 modules +runtime modules 14.4 KiB 18 modules cacheable modules 1.05 KiB built modules 844 bytes [built] orphan modules 325 bytes [orphan] @@ -1861,7 +1861,7 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` > ./c c dependent modules 80 bytes [dependent] 4 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 7.38 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{753}< [entry] [rendered] + chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{753}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] chunk (runtime: a, main) default/async-g.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{74}> <{753}> ={581}= [rendered] @@ -1994,7 +1994,7 @@ manual: > z c dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) manual/main.js (main) 147 bytes (javascript) 7.38 KiB (runtime) >{172}< >{192}< >{250}< >{262}< [entry] [rendered] + chunk (runtime: main) manual/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) >{172}< >{192}< >{250}< >{262}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] chunk (runtime: a, main) manual/async-g.js (async-g) 65 bytes <{192}> <{250}> <{74}> [rendered] @@ -2125,7 +2125,7 @@ custom-chunks-filter: chunk (runtime: c) custom-chunks-filter/c.js (c) 116 bytes (javascript) 2.86 KiB (runtime) ={416}= ={418}= ={581}= ={753}= [entry] [rendered] > ./c c ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter/main.js (main) 147 bytes (javascript) 7.39 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{753}< [entry] [rendered] + chunk (runtime: main) custom-chunks-filter/main.js (main) 147 bytes (javascript) 7.28 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{753}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] chunk (runtime: a, main) custom-chunks-filter/async-g.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{74}> <{753}> ={581}= [rendered] @@ -2194,7 +2194,7 @@ custom-chunks-filter-in-cache-groups: > z c dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter-in-cache-groups/main.js (main) 147 bytes (javascript) 7.41 KiB (runtime) >{172}< >{192}< >{250}< >{262}< [entry] [rendered] + chunk (runtime: main) custom-chunks-filter-in-cache-groups/main.js (main) 147 bytes (javascript) 7.3 KiB (runtime) >{172}< >{192}< >{250}< >{262}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] chunk (runtime: a, main) custom-chunks-filter-in-cache-groups/async-g.js (async-g) 65 bytes <{192}> <{250}> <{598}> <{74}> [rendered] @@ -2205,7 +2205,7 @@ custom-chunks-filter-in-cache-groups: `; exports[`StatsTestCases should print correct stats for split-chunks-automatic-name 1`] = ` -"Entrypoint main 9.57 KiB = main.js +"Entrypoint main 9.46 KiB = main.js chunk (runtime: main) async-a.js (async-a) (id hint: common) 136 bytes <{main}> ={common-d_js}= ={common-node_modules_x_js}= ={common-node_modules_y_js}= [rendered] > ./a ./index.js 1:0-47 ./a.js + 1 modules 136 bytes [code generated] @@ -2236,14 +2236,14 @@ chunk (runtime: main) common-node_modules_y_js.js (id hint: common) 20 bytes <{m chunk (runtime: main) common-node_modules_z_js.js (id hint: common) 20 bytes <{main}> ={async-c}= ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= [rendered] split chunk (cache group: b) > ./c ./index.js 3:0-47 ./node_modules/z.js 20 bytes [built] [code generated] -chunk (runtime: main) main.js (main) (id hint: common) 147 bytes (javascript) 7.28 KiB (runtime) >{async-a}< >{async-b}< >{async-c}< >{common-d_js}< >{common-f_js}< >{common-node_modules_x_js}< >{common-node_modules_y_js}< >{common-node_modules_z_js}< [entry] [rendered] +chunk (runtime: main) main.js (main) (id hint: common) 147 bytes (javascript) 7.17 KiB (runtime) >{async-a}< >{async-b}< >{async-c}< >{common-d_js}< >{common-f_js}< >{common-node_modules_x_js}< >{common-node_modules_y_js}< >{common-node_modules_z_js}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] production (Rspack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-chunk-name 1`] = ` -"Entrypoint main 9.22 KiB = default/main.js +"Entrypoint main 9.11 KiB = default/main.js chunk (runtime: main) default/async-a.js (async-a) 20 bytes <{909}> [rendered] > a ./index.js 1:0-45 ./node_modules/a.js 20 bytes [built] [code generated] @@ -2254,14 +2254,14 @@ chunk (runtime: main) default/async-c-1.js (async-c-1) (id hint: vendors) 122 by > c ./index.js 3:0-47 > c ./index.js 4:0-47 ./node_modules/c.js 122 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 192 bytes (javascript) 7.35 KiB (runtime) >{250}< >{262}< >{589}< [entry] [rendered] +chunk (runtime: main) default/main.js (main) 192 bytes (javascript) 7.24 KiB (runtime) >{250}< >{262}< >{589}< [entry] [rendered] > ./ main ./index.js 192 bytes [built] [code generated] Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-combinations 1`] = ` -"Entrypoint main 9.69 KiB = main.js +"Entrypoint main 9.58 KiB = main.js chunk (runtime: main) async-c.js (async-c) 132 bytes <{909}> [rendered] > ./c ./index.js 3:0-47 dependent modules 87 bytes [dependent] 1 module @@ -2289,7 +2289,7 @@ chunk (runtime: main) async-d.js (async-d) 132 bytes <{909}> [rendered] > ./d ./index.js 4:0-47 dependent modules 87 bytes [dependent] 1 module ./d.js 45 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 343 bytes (javascript) 7.41 KiB (runtime) >{172}< >{198}< >{250}< >{262}< >{36}< >{407}< >{602}< >{912}< [entry] [rendered] +chunk (runtime: main) main.js (main) 343 bytes (javascript) 7.3 KiB (runtime) >{172}< >{198}< >{250}< >{262}< >{36}< >{407}< >{602}< >{912}< [entry] [rendered] > ./ main ./index.js 343 bytes [built] [code generated] chunk (runtime: main) async-g.js (async-g) 132 bytes <{909}> [rendered] @@ -2300,7 +2300,7 @@ Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-issue-6413 1`] = ` -"Entrypoint main 9.32 KiB = main.js +"Entrypoint main 9.21 KiB = main.js chunk (runtime: main) async-c.js (async-c) 36 bytes <{909}> ={306}= ={418}= [rendered] > ./c ./index.js 3:0-47 ./c.js 36 bytes [built] [code generated] @@ -2320,7 +2320,7 @@ chunk (runtime: main) 418.js (id hint: vendors) 20 bytes <{909}> ={172}= ={250}= > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 ./node_modules/x.js 20 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 147 bytes (javascript) 7.34 KiB (runtime) >{172}< >{250}< >{262}< >{306}< >{418}< [entry] [rendered] +chunk (runtime: main) main.js (main) 147 bytes (javascript) 7.23 KiB (runtime) >{172}< >{250}< >{262}< >{306}< >{418}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] default (Rspack x.x.x) compiled successfully" @@ -2339,7 +2339,7 @@ chunk (runtime: main) async-b.js (async-b) 49 bytes <{192}> <{909}> [rendered] > ./b ./index.js 3:0-47 dependent modules 20 bytes [dependent] 1 module ./b.js 29 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 134 bytes (javascript) 8.4 KiB (runtime) ={192}= >{250}< >{262}< [entry] [rendered] +chunk (runtime: main) main.js (main) 134 bytes (javascript) 8.29 KiB (runtime) ={192}= >{250}< >{262}< [entry] [rendered] > ./ main ./index.js 134 bytes [built] [code generated] default (Rspack x.x.x) compiled successfully" @@ -2356,7 +2356,7 @@ chunk (runtime: a, b) 418.js (id hint: vendors) 20 bytes <{751}> ={74}= ={76}= [ chunk (runtime: a) a.js (a) 35 bytes (javascript) 2.86 KiB (runtime) ={418}= [entry] [rendered] > ./a a ./a.js 35 bytes [built] [code generated] -chunk (runtime: b) b.js (b) 43 bytes (javascript) 7.3 KiB (runtime) >{418}< >{76}< [entry] [rendered] +chunk (runtime: b) b.js (b) 43 bytes (javascript) 7.19 KiB (runtime) >{418}< >{76}< [entry] [rendered] > ./b b ./b.js 43 bytes [built] [code generated] chunk (runtime: b) c.js (c) 35 bytes <{751}> ={418}= [rendered] @@ -2366,7 +2366,7 @@ default (Rspack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-keep-remaining-size 1`] = ` -"Entrypoint main 9.41 KiB = default/main.js +"Entrypoint main 9.3 KiB = default/main.js chunk (runtime: main) default/async-c.js (async-c) 50 bytes <{909}> ={44}= [rendered] > ./c ./index.js 3:0-47 ./c.js 50 bytes [built] [code generated] @@ -2390,7 +2390,7 @@ chunk (runtime: main) default/async-d.js (async-d) 84 bytes <{909}> ={403}= [ren chunk (runtime: main) default/728.js (id hint: vendors) 126 bytes <{909}> ={250}= [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 ./node_modules/shared.js?1 126 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 196 bytes (javascript) 7.38 KiB (runtime) >{172}< >{250}< >{262}< >{403}< >{44}< >{602}< >{728}< [entry] [rendered] +chunk (runtime: main) default/main.js (main) 196 bytes (javascript) 7.27 KiB (runtime) >{172}< >{250}< >{262}< >{403}< >{44}< >{602}< >{728}< [entry] [rendered] > ./ main ./index.js 196 bytes [built] [code generated] Rspack x.x.x compiled successfully" @@ -2427,7 +2427,7 @@ Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-prefer-bigger-splits 1`] = ` -"Entrypoint main 9.2 KiB = default/main.js +"Entrypoint main 9.09 KiB = default/main.js chunk (runtime: main) default/async-c.js (async-c) 70 bytes <{909}> ={457}= [rendered] > ./c ./index.js 3:0-47 ./c.js 70 bytes [built] [code generated] @@ -2444,7 +2444,7 @@ chunk (runtime: main) default/457.js (id hint: ) 150 bytes <{909}> ={172}= ={262 > ./c ./index.js 3:0-47 ./d.js 63 bytes [built] [code generated] ./f.js 87 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 7.36 KiB (runtime) >{172}< >{250}< >{262}< >{457}< [entry] [rendered] +chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 7.25 KiB (runtime) >{172}< >{250}< >{262}< >{457}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] Rspack x.x.x compiled successfully" From fc9b7637e7620e4130d4ff909a7f47427dfee361 Mon Sep 17 00:00:00 2001 From: GiveMe-A-Name Date: Thu, 13 Feb 2025 15:14:38 +0800 Subject: [PATCH 2/3] test: update snapshot files --- ...NewCodeSplitting-stats-output.test.js.snap | 20 +-- .../__snapshots__/StatsOutput.test.js.snap | 20 +-- .../StatsTestCases.basictest.js.snap | 136 +++++++++--------- 3 files changed, 88 insertions(+), 88 deletions(-) diff --git a/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap index 192b6b4df167..ffd2ef2057ca 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap @@ -58,7 +58,7 @@ runtime modules 1.5 KiB [no exports] [used exports unknown] -Rspack compiled successfully (d02a6857e8f1f969) +Rspack compiled successfully (2e20f72b3f1c2ac4) `; exports[`new code splitting stats output new code splitting stats output/builtin-swc-loader-parse-error should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` @@ -96,9 +96,9 @@ Rspack x.x.x compiled successfully in X s `; exports[`new code splitting stats output new code splitting stats output/filename should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset 909.xxxx.js 9.15 KiB [emitted] (name: main) +asset 909.xxxx.js 9.05 KiB [emitted] (name: main) asset 521.xxxx.js 320 bytes [emitted] -runtime modules 7.55 KiB 11 modules +runtime modules 7.45 KiB 11 modules cacheable modules 70 bytes ./index.js 38 bytes [built] [code generated] ./dynamic.js 32 bytes [built] [code generated] @@ -142,14 +142,14 @@ Rspack compiled with 1 error exports[`new code splitting stats output new code splitting stats output/limit-chunk-count-plugin should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` 1 chunks: - asset bundle1.js 3.6 KiB [emitted] (name: main) + asset bundle1.js 3.59 KiB [emitted] (name: main) chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.78 KiB (runtime) <{909}> >{909}< [entry] [rendered] dependent modules 96 bytes [dependent] 4 modules ./index.js 123 bytes [built] [code generated] 1 chunks (Rspack x.x.x) compiled successfully in X s 2 chunks: - asset bundle2.js 10.6 KiB [emitted] (name: main) + asset bundle2.js 10.5 KiB [emitted] (name: main) asset 76.bundle2.js 491 bytes [emitted] (name: c) chunk (runtime: main) 76.bundle2.js (c) 74 bytes <{76}> <{909}> >{76}< [rendered] dependent modules 44 bytes [dependent] 2 modules @@ -160,7 +160,7 @@ exports[`new code splitting stats output new code splitting stats output/limit-c 2 chunks (Rspack x.x.x) compiled successfully in X s 3 chunks: - asset bundle3.js 10.6 KiB [emitted] (name: main) + asset bundle3.js 10.5 KiB [emitted] (name: main) asset 76.bundle3.js 385 bytes [emitted] (name: c) asset 345.bundle3.js 182 bytes [emitted] chunk (runtime: main) 345.bundle3.js 44 bytes <{76}> [rendered] @@ -174,7 +174,7 @@ exports[`new code splitting stats output new code splitting stats output/limit-c 3 chunks (Rspack x.x.x) compiled successfully in X s 4 chunks: - asset bundle4.js 10.6 KiB [emitted] (name: main) + asset bundle4.js 10.5 KiB [emitted] (name: main) asset 76.bundle4.js 385 bytes [emitted] (name: c) asset 697.bundle4.js 128 bytes [emitted] asset 753.bundle4.js 128 bytes [emitted] @@ -225,7 +225,7 @@ Rspack compiled with 2 errors `; exports[`new code splitting stats output new code splitting stats output/named-chunk-group should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -Entrypoint main 9.14 KiB = main.js +Entrypoint main 9.04 KiB = main.js Chunk Group cimanyd 320 bytes = cimanyd.js `; @@ -335,11 +335,11 @@ cacheable modules 293 KiB ./e.js 22 bytes [built] [code generated] ERROR in × asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance.Assets: - │ main.js (303.823 KiB) + │ main.js (303.652 KiB) ERROR in × entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance.Entrypoints: - │ main (303.823 KiB) + │ main (303.652 KiB) │ main.js diff --git a/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap index 59bbb73e105b..6799c1e8cca2 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap @@ -58,7 +58,7 @@ runtime modules 1.5 KiB [no exports] [used exports unknown] -Rspack compiled successfully (d02a6857e8f1f969) +Rspack compiled successfully (2e20f72b3f1c2ac4) `; exports[`statsOutput statsOutput/builtin-swc-loader-parse-error should print correct stats for 1`] = ` @@ -96,9 +96,9 @@ Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/filename should print correct stats for 1`] = ` -asset 909.xxxx.js 9.15 KiB [emitted] (name: main) +asset 909.xxxx.js 9.05 KiB [emitted] (name: main) asset 521.xxxx.js 320 bytes [emitted] -runtime modules 7.55 KiB 11 modules +runtime modules 7.45 KiB 11 modules cacheable modules 70 bytes ./index.js 38 bytes [built] [code generated] ./dynamic.js 32 bytes [built] [code generated] @@ -142,14 +142,14 @@ Rspack compiled with 1 error exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct stats for 1`] = ` 1 chunks: - asset bundle1.js 3.6 KiB [emitted] (name: main) + asset bundle1.js 3.59 KiB [emitted] (name: main) chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.78 KiB (runtime) <{909}> >{909}< [entry] [rendered] dependent modules 96 bytes [dependent] 4 modules ./index.js 123 bytes [built] [code generated] 1 chunks (Rspack x.x.x) compiled successfully in X s 2 chunks: - asset bundle2.js 10.6 KiB [emitted] (name: main) + asset bundle2.js 10.5 KiB [emitted] (name: main) asset 76.bundle2.js 491 bytes [emitted] (name: c) chunk (runtime: main) 76.bundle2.js (c) 74 bytes <{76}> <{909}> >{76}< [rendered] dependent modules 44 bytes [dependent] 2 modules @@ -160,7 +160,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s 2 chunks (Rspack x.x.x) compiled successfully in X s 3 chunks: - asset bundle3.js 10.6 KiB [emitted] (name: main) + asset bundle3.js 10.5 KiB [emitted] (name: main) asset 76.bundle3.js 385 bytes [emitted] (name: c) asset 345.bundle3.js 182 bytes [emitted] chunk (runtime: main) 345.bundle3.js 44 bytes <{76}> [rendered] @@ -174,7 +174,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s 3 chunks (Rspack x.x.x) compiled successfully in X s 4 chunks: - asset bundle4.js 10.6 KiB [emitted] (name: main) + asset bundle4.js 10.5 KiB [emitted] (name: main) asset 76.bundle4.js 385 bytes [emitted] (name: c) asset 697.bundle4.js 128 bytes [emitted] asset 753.bundle4.js 128 bytes [emitted] @@ -225,7 +225,7 @@ Rspack compiled with 2 errors `; exports[`statsOutput statsOutput/named-chunk-group should print correct stats for 1`] = ` -Entrypoint main 9.14 KiB = main.js +Entrypoint main 9.04 KiB = main.js Chunk Group cimanyd 320 bytes = cimanyd.js `; @@ -335,11 +335,11 @@ cacheable modules 293 KiB ./e.js 22 bytes [built] [code generated] ERROR in × asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance.Assets: - │ main.js (303.823 KiB) + │ main.js (303.652 KiB) ERROR in × entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance.Entrypoints: - │ main (303.823 KiB) + │ main (303.652 KiB) │ main.js diff --git a/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap b/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap index 92e89e50b4fb..2d9dada4eaaa 100644 --- a/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap +++ b/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap @@ -39,7 +39,7 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk 1`] = "chunk (runtime: main) 726.js 21 bytes <{909}> [rendered] > ./index.js 9:4-13:6 ./b.js 21 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 557 bytes (javascript) 6.72 KiB (runtime) >{726}< [entry] [rendered] +chunk (runtime: main) main.js (main) 557 bytes (javascript) 6.61 KiB (runtime) >{726}< [entry] [rendered] > ./ main dependent modules 42 bytes [dependent] 2 modules ./index.js 515 bytes [built] [code generated] @@ -60,7 +60,7 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto > ./b ./index.js 2:0-47 dependent modules 80 bytes [dependent] 4 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: a) disabled/a.js (a) 245 bytes (javascript) 7.29 KiB (runtime) [entry] [rendered] + chunk (runtime: a) disabled/a.js (a) 245 bytes (javascript) 7.19 KiB (runtime) [entry] [rendered] > ./a a dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] @@ -72,7 +72,7 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto > ./c c dependent modules 60 bytes [dependent] 3 modules ./c.js + 1 modules 136 bytes [code generated] - chunk (runtime: main) disabled/main.js (main) 147 bytes (javascript) 7.36 KiB (runtime) [entry] [rendered] + chunk (runtime: main) disabled/main.js (main) 147 bytes (javascript) 7.25 KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] chunk (runtime: a, main) disabled/async-g.js (async-g) 65 bytes [rendered] @@ -108,7 +108,7 @@ default: > ./c ./index.js 3:0-47 > ./g ./a.js 6:0-47 ./f.js 20 bytes [built] [code generated] - chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 7.32 KiB (runtime) [entry] [rendered] + chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 7.22 KiB (runtime) [entry] [rendered] > ./a a dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] @@ -134,8 +134,8 @@ default: default (Rspack x.x.x) compiled successfully vendors: - Entrypoint main 9.12 KiB = vendors/main.js - Entrypoint a 11.9 KiB = vendors/vendors.js 829 bytes vendors/a.js 11 KiB + Entrypoint main 9.01 KiB = vendors/main.js + Entrypoint a 11.7 KiB = vendors/vendors.js 829 bytes vendors/a.js 10.9 KiB Entrypoint b 6.32 KiB = vendors/vendors.js 829 bytes vendors/b.js 5.51 KiB Entrypoint c 6.32 KiB = vendors/vendors.js 829 bytes vendors/c.js 5.51 KiB chunk (runtime: main) vendors/async-c.js (async-c) 196 bytes [rendered] @@ -157,7 +157,7 @@ vendors: > ./b ./index.js 2:0-47 dependent modules 80 bytes [dependent] 4 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: a) vendors/a.js (a) 205 bytes (javascript) 8.38 KiB (runtime) [entry] [rendered] + chunk (runtime: a) vendors/a.js (a) 205 bytes (javascript) 8.27 KiB (runtime) [entry] [rendered] > ./a a dependent modules 20 bytes [dependent] 1 module ./a.js + 1 modules 185 bytes [code generated] @@ -205,8 +205,8 @@ multiple-vendors: multiple-vendors (Rspack x.x.x) compiled successfully all: - Entrypoint main 10.9 KiB = all/605.js 820 bytes all/main.js 10.1 KiB - Entrypoint a 12.3 KiB = all/457.js 582 bytes all/310.js 335 bytes all/697.js 335 bytes all/272.js 957 bytes all/a.js 10.2 KiB + Entrypoint main 10.8 KiB = all/605.js 820 bytes all/main.js 10 KiB + Entrypoint a 12.2 KiB = all/457.js 582 bytes all/310.js 335 bytes all/697.js 335 bytes all/272.js 957 bytes all/a.js 10.1 KiB Entrypoint b 6.35 KiB = all/457.js 582 bytes all/581.js 335 bytes all/310.js 335 bytes all/726.js 800 bytes all/b.js 4.35 KiB Entrypoint c 6.35 KiB = all/457.js 582 bytes all/581.js 335 bytes all/416.js 335 bytes all/29.js 799 bytes all/c.js 4.35 KiB chunk (runtime: main) all/199.js (id hint: vendors) 116 bytes [rendered] split chunk (cache group: vendors) @@ -382,8 +382,8 @@ Rspack x.x.x compiled successfully in X.23" exports[`StatsTestCases should print correct stats for exclude-with-loader 1`] = ` "hidden assets 34 bytes 1 asset -asset bundle.js 4.59 KiB [emitted] (name: main) -runtime modules 2.27 KiB 5 modules +asset bundle.js 4.49 KiB [emitted] (name: main) +runtime modules 2.17 KiB 5 modules hidden modules 99 bytes 2 modules cacheable modules 119 bytes ./index.js 77 bytes [built] [code generated] @@ -502,11 +502,11 @@ asset 7342054f673663df.js 167 bytes [emitted] [immutable]" `; exports[`StatsTestCases should print correct stats for import-context-filter 1`] = ` -"asset entry.js 10.1 KiB [emitted] (name: entry) +"asset entry.js 9.99 KiB [emitted] (name: entry) asset 228.js 405 bytes [emitted] asset 271.js 405 bytes [emitted] asset 536.js 405 bytes [emitted] -runtime modules 7.28 KiB 9 modules +runtime modules 7.17 KiB 9 modules cacheable modules 724 bytes modules by path ./templates/*.js 114 bytes ./templates/bar.js 38 bytes [built] [code generated] @@ -518,10 +518,10 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for import-weak 1`] = ` -"asset entry.js 10.2 KiB [emitted] (name: entry) +"asset entry.js 10.1 KiB [emitted] (name: entry) asset 332.js 283 bytes [emitted] asset 313.js 128 bytes [emitted] -runtime modules 8.46 KiB 10 modules +runtime modules 8.28 KiB 10 modules cacheable modules 179 bytes ./entry.js 120 bytes [built] [code generated] ./modules/a.js 37 bytes [built] [code generated] @@ -530,10 +530,10 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for import-weak-parser-option 1`] = ` -"asset entry.js 10.2 KiB [emitted] (name: entry) +"asset entry.js 10.1 KiB [emitted] (name: entry) asset 332.js 283 bytes [emitted] asset 313.js 128 bytes [emitted] -runtime modules 8.46 KiB 10 modules +runtime modules 8.28 KiB 10 modules cacheable modules 153 bytes ./entry.js 94 bytes [built] [code generated] ./modules/a.js 37 bytes [built] [code generated] @@ -617,8 +617,8 @@ Rspack x.x.x compiled successfully in X.23" exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1`] = ` "1 chunks: - asset bundle1.js 3.86 KiB [emitted] (name: main) - chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.84 KiB (runtime) <{909}> >{909}< [entry] [rendered] + asset bundle1.js 3.79 KiB [emitted] (name: main) + chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.78 KiB (runtime) <{909}> >{909}< [entry] [rendered] ./a.js 22 bytes [dependent] [built] [code generated] ./b.js 22 bytes [dependent] [built] [code generated] ./c.js 30 bytes [dependent] [built] [code generated] @@ -628,7 +628,7 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1 chunks (Rspack x.x.x) compiled successfully in X.23 2 chunks: - asset bundle2.js 10.3 KiB [emitted] (name: main) + asset bundle2.js 10.1 KiB [emitted] (name: main) asset 76.bundle2.js 599 bytes [emitted] (name: c) chunk (runtime: main) 76.bundle2.js (c) 118 bytes <{76}> <{909}> >{76}< [rendered] dependent modules 44 bytes [dependent] @@ -642,7 +642,7 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 2 chunks (Rspack x.x.x) compiled successfully in X.23 3 chunks: - asset bundle3.js 10.3 KiB [emitted] (name: main) + asset bundle3.js 10.1 KiB [emitted] (name: main) asset 76.bundle3.js 385 bytes [emitted] (name: c) asset 656.bundle3.js 290 bytes [emitted] chunk (runtime: main) 656.bundle3.js 88 bytes <{76}> <{909}> [rendered] @@ -657,7 +657,7 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 3 chunks (Rspack x.x.x) compiled successfully in X.23 4 chunks: - asset bundle4.js 10.3 KiB [emitted] (name: main) + asset bundle4.js 10.1 KiB [emitted] (name: main) asset 76.bundle4.js 385 bytes [emitted] (name: c) asset 537.bundle4.js 236 bytes [emitted] asset 697.bundle4.js 128 bytes [emitted] @@ -727,14 +727,14 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for module-assets 1`] = ` -"assets by path *.js 9.03 KiB - asset main.js 8.59 KiB [emitted] (name: main) +"assets by path *.js 8.92 KiB + asset main.js 8.48 KiB [emitted] (name: main) asset b.js 224 bytes [emitted] (name: b) asset a.js 223 bytes [emitted] (name: a) assets by path *.png 42 KiB asset 1.png 21 KiB [emitted] [from: node_modules/a/1.png] asset 2.png 21 KiB [emitted] [from: node_modules/a/2.png] -Entrypoint main 8.59 KiB = main.js +Entrypoint main 8.48 KiB = main.js Chunk Group a 223 bytes = a.js Chunk Group b 224 bytes = b.js chunk (runtime: main) a.js (a) 36 bytes [rendered] @@ -753,9 +753,9 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for module-deduplication 1`] = ` -"asset e1.js 9.98 KiB [emitted] (name: e1) -asset e2.js 9.98 KiB [emitted] (name: e2) -asset e3.js 9.98 KiB [emitted] (name: e3) +"asset e1.js 9.87 KiB [emitted] (name: e1) +asset e2.js 9.87 KiB [emitted] (name: e2) +asset e3.js 9.87 KiB [emitted] (name: e3) asset 106.js 749 bytes [emitted] asset 511.js 749 bytes [emitted] asset 637.js 749 bytes [emitted] @@ -793,9 +793,9 @@ Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for module-deduplication-named 1`] = ` -"asset e1.js 9.84 KiB [emitted] (name: e1) -asset e2.js 9.84 KiB [emitted] (name: e2) -asset e3.js 9.84 KiB [emitted] (name: e3) +"asset e1.js 9.73 KiB [emitted] (name: e1) +asset e2.js 9.73 KiB [emitted] (name: e2) +asset e3.js 9.73 KiB [emitted] (name: e3) asset async1.js 861 bytes [emitted] (name: async1) asset async2.js 860 bytes [emitted] (name: async2) asset async3.js 860 bytes [emitted] (name: async3) @@ -929,7 +929,7 @@ exports[`StatsTestCases should print correct stats for named-chunk-groups 1`] = "Chunk Group async-a 997 bytes = a-727.js 248 bytes a-async-a.js 749 bytes Chunk Group async-b 997 bytes = a-727.js 248 bytes a-async-b.js 749 bytes Chunk Group async-c 1.21 KiB = a-vendors.js 582 bytes a-async-c.js 652 bytes -Chunk Group main 9.6 KiB = a-main.js +Chunk Group main 9.5 KiB = a-main.js chunk (runtime: main) a-async-c.js (async-c) 67 bytes [rendered] > ./c ./index.js 3:0-47 ./c.js 67 bytes [built] [code generated] @@ -952,7 +952,7 @@ chunk (runtime: main) a-main.js (main) 146 bytes (javascript) 7.55 KiB (runtime) ./index.js 146 bytes [built] [code generated] Rspack x.x.x compiled successfully -Entrypoint main 9.6 KiB = b-main.js +Entrypoint main 9.5 KiB = b-main.js Chunk Group async-a 997 bytes = b-727.js 248 bytes b-async-a.js 749 bytes Chunk Group async-b 997 bytes = b-727.js 248 bytes b-async-b.js 749 bytes Chunk Group async-c 1.21 KiB = b-vendors.js 582 bytes b-async-c.js 652 bytes @@ -993,7 +993,7 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = ` -"asset main.js 9.3 KiB {909} [emitted] (name: main) +"asset main.js 9.19 KiB {909} [emitted] (name: main) asset cir2 from cir1.js 351 bytes {334} [emitted] (name: cir2 from cir1) asset cir1.js 325 bytes {228} [emitted] (name: cir1) asset cir2.js 325 bytes {787} [emitted] (name: cir2) @@ -1040,9 +1040,9 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for output-module 1`] = ` -"asset main.mjs 7.92 KiB [emitted] [javascript module] (name: main) +"asset main.mjs 7.88 KiB [emitted] [javascript module] (name: main) asset 8.mjs 268 bytes [emitted] [javascript module] -runtime modules 6.21 KiB 8 modules +runtime modules 6.18 KiB 8 modules orphan modules 225 bytes [orphan] 2 modules cacheable modules 263 bytes ./index.js + 1 modules 225 bytes [code generated] @@ -1203,14 +1203,14 @@ Rspack x.x.x compiled with 3 errors in X s" `; exports[`StatsTestCases should print correct stats for prefetch 1`] = ` -"asset main.js 14 KiB {909} [emitted] (name: main) +"asset main.js 13.7 KiB {909} [emitted] (name: main) asset prefetched.js 552 bytes {674} [emitted] (name: prefetched) asset inner2.js 126 bytes {857} [emitted] (name: inner2) asset inner.js 100 bytes {481} [emitted] (name: inner) asset normal.js 100 bytes {615} [emitted] (name: normal) asset prefetched2.js 100 bytes {424} [emitted] (name: prefetched2) asset prefetched3.js 100 bytes {182} [emitted] (name: prefetched3) -Entrypoint main 14 KiB = main.js +Entrypoint main 13.7 KiB = main.js prefetch: prefetched.js {674} (name: prefetched), prefetched3.js {182} (name: prefetched3), prefetched2.js {424} (name: prefetched2) chunk {182} (runtime: main) prefetched3.js (prefetched3) 1 bytes <{909}> [rendered] chunk {424} (runtime: main) prefetched2.js (prefetched2) 1 bytes <{909}> [rendered] @@ -1236,14 +1236,14 @@ chunk (runtime: main) main.js (main) 195 bytes (javascript) 11.5 KiB (runtime) > `; exports[`StatsTestCases should print correct stats for preload 1`] = ` -"asset main.js 12.5 KiB [emitted] (name: main) +"asset main.js 12.3 KiB [emitted] (name: main) asset preloaded.js 552 bytes [emitted] (name: preloaded) asset inner2.js 126 bytes [emitted] (name: inner2) asset inner.js 100 bytes [emitted] (name: inner) asset normal.js 100 bytes [emitted] (name: normal) asset preloaded2.js 99 bytes [emitted] (name: preloaded2) asset preloaded3.js 98 bytes [emitted] (name: preloaded3) -Entrypoint main 12.5 KiB = main.js +Entrypoint main 12.3 KiB = main.js preload: preloaded.js {154} (name: preloaded), preloaded3.js {551} (name: preloaded3), preloaded2.js {577} (name: preloaded2) chunk (runtime: main) preloaded.js (preloaded) 226 bytes (preload: {857} {481}) [rendered] chunk (runtime: main) inner.js (inner) 1 bytes [rendered] @@ -1455,8 +1455,8 @@ Rspack x.x.x compiled successfully" exports[`StatsTestCases should print correct stats for runtime-specific-used-exports 1`] = ` "production: - asset production-a.js 10.6 KiB [emitted] (name: a) - asset production-b.js 10.6 KiB [emitted] (name: b) + asset production-a.js 10.5 KiB [emitted] (name: a) + asset production-b.js 10.5 KiB [emitted] (name: b) asset production-dx_js.js 843 bytes [emitted] asset production-dw_js-_b3b00.js 834 bytes [emitted] asset production-dw_js-_b3b01.js 834 bytes [emitted] @@ -1614,8 +1614,8 @@ development: development (Rspack x.x.x) compiled successfully in X.23 global: - asset global-a.js 10.7 KiB [emitted] (name: a) - asset global-b.js 10.7 KiB [emitted] (name: b) + asset global-a.js 10.6 KiB [emitted] (name: a) + asset global-b.js 10.6 KiB [emitted] (name: b) asset global-dw_js.js 843 bytes [emitted] asset global-dx_js.js 843 bytes [emitted] asset global-dy_js.js 843 bytes [emitted] @@ -1725,9 +1725,9 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for side-effects-issue-7428 1`] = ` -"asset main.js 10.1 KiB [emitted] (name: main) +"asset main.js 9.96 KiB [emitted] (name: main) asset 0.js 561 bytes [emitted] -runtime modules 7.27 KiB 9 modules +runtime modules 7.17 KiB 9 modules cacheable modules 967 bytes modules by path ./components/src/ 501 bytes orphan modules 315 bytes [orphan] @@ -1814,8 +1814,8 @@ Rspack x.x.x compiled successfully in X.23" exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` "default: - Entrypoint main 9.5 KiB = default/main.js - Entrypoint a 10.2 KiB = default/a.js + Entrypoint main 9.39 KiB = default/main.js + Entrypoint a 10.1 KiB = default/a.js Entrypoint b 3.06 KiB = default/b.js Entrypoint c 3.06 KiB = default/c.js chunk (runtime: main) default/async-c.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] @@ -1844,7 +1844,7 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` > ./c ./index.js 3:0-47 > ./g ./a.js 6:0-47 ./f.js 20 bytes [built] [code generated] - chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 7.32 KiB (runtime) >{581}< >{912}< [entry] [rendered] + chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 7.22 KiB (runtime) >{581}< >{912}< [entry] [rendered] > ./a a dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] @@ -1870,8 +1870,8 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` default (Rspack x.x.x) compiled successfully all-chunks: - Entrypoint main 9.53 KiB = all-chunks/main.js - Entrypoint a 12.4 KiB = all-chunks/418.js 335 bytes all-chunks/310.js 335 bytes all-chunks/753.js 335 bytes all-chunks/697.js 335 bytes all-chunks/a.js 11.1 KiB + Entrypoint main 9.42 KiB = all-chunks/main.js + Entrypoint a 12.3 KiB = all-chunks/418.js 335 bytes all-chunks/310.js 335 bytes all-chunks/753.js 335 bytes all-chunks/697.js 335 bytes all-chunks/a.js 10.9 KiB Entrypoint b 6.36 KiB = all-chunks/418.js 335 bytes all-chunks/310.js 335 bytes all-chunks/753.js 335 bytes all-chunks/581.js 335 bytes all-chunks/b.js 5.05 KiB Entrypoint c 6.35 KiB = all-chunks/418.js 335 bytes all-chunks/416.js 335 bytes all-chunks/753.js 335 bytes all-chunks/581.js 335 bytes all-chunks/c.js 5.05 KiB chunk (runtime: main) all-chunks/async-c.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] @@ -1912,7 +1912,7 @@ all-chunks: > ./a ./index.js 1:0-47 > ./a a ./e.js 20 bytes [built] [code generated] - chunk (runtime: a) all-chunks/a.js (a) 165 bytes (javascript) 8.41 KiB (runtime) ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [entry] [rendered] + chunk (runtime: a) all-chunks/a.js (a) 165 bytes (javascript) 8.3 KiB (runtime) ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [entry] [rendered] > ./a a ./a.js 165 bytes [built] [code generated] chunk (runtime: b) all-chunks/b.js (b) 116 bytes (javascript) 2.86 KiB (runtime) ={310}= ={418}= ={581}= ={753}= [entry] [rendered] @@ -1929,7 +1929,7 @@ all-chunks: chunk (runtime: c) all-chunks/c.js (c) 116 bytes (javascript) 2.86 KiB (runtime) ={416}= ={418}= ={581}= ={753}= [entry] [rendered] > ./c c ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) all-chunks/main.js (main) 147 bytes (javascript) 7.38 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{697}< >{753}< [entry] [rendered] + chunk (runtime: main) all-chunks/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{697}< >{753}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] chunk (runtime: a, main) all-chunks/async-g.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{697}> <{74}> <{753}> ={581}= [rendered] @@ -1938,8 +1938,8 @@ all-chunks: all-chunks (Rspack x.x.x) compiled successfully manual: - Entrypoint main 9.26 KiB = manual/main.js - Entrypoint a 12.1 KiB = manual/vendors.js 829 bytes manual/a.js 11.3 KiB + Entrypoint main 9.16 KiB = manual/main.js + Entrypoint a 12 KiB = manual/vendors.js 829 bytes manual/a.js 11.2 KiB Entrypoint b 6.58 KiB = manual/vendors.js 829 bytes manual/b.js 5.78 KiB Entrypoint c 6.58 KiB = manual/vendors.js 829 bytes manual/c.js 5.77 KiB chunk (runtime: main) manual/async-c.js (async-c) 156 bytes <{909}> ={192}= [rendered] @@ -1973,7 +1973,7 @@ manual: > ./b ./index.js 2:0-47 dependent modules 40 bytes [dependent] 2 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: a) manual/a.js (a) 205 bytes (javascript) 8.38 KiB (runtime) ={192}= >{912}< [entry] [rendered] + chunk (runtime: a) manual/a.js (a) 205 bytes (javascript) 8.27 KiB (runtime) ={192}= >{912}< [entry] [rendered] > ./a a > x a > y a @@ -2004,8 +2004,8 @@ manual: manual (Rspack x.x.x) compiled successfully name-too-long: - Entrypoint main 9.53 KiB = name-too-long/main.js - Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 12.4 KiB = name-too-long/418.js 335 bytes name-too-long/310.js 335 bytes name-too-long/753.js 335 bytes name-too-long/697.js 335 bytes name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js 11.1 KiB + Entrypoint main 9.42 KiB = name-too-long/main.js + Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 12.3 KiB = name-too-long/418.js 335 bytes name-too-long/310.js 335 bytes name-too-long/753.js 335 bytes name-too-long/697.js 335 bytes name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js 10.9 KiB Entrypoint bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 6.36 KiB = name-too-long/418.js 335 bytes name-too-long/310.js 335 bytes name-too-long/753.js 335 bytes name-too-long/581.js 335 bytes name-too-long/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js 5.05 KiB Entrypoint cccccccccccccccccccccccccccccc 6.36 KiB = name-too-long/418.js 335 bytes name-too-long/416.js 335 bytes name-too-long/753.js 335 bytes name-too-long/581.js 335 bytes name-too-long/cccccccccccccccccccccccccccccc.js 5.05 KiB chunk (runtime: main) name-too-long/async-c.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] @@ -2060,20 +2060,20 @@ name-too-long: > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > ./c cccccccccccccccccccccccccccccc ./d.js 20 bytes [built] [code generated] - chunk (runtime: main) name-too-long/main.js (main) 147 bytes (javascript) 7.38 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{697}< >{753}< [entry] [rendered] + chunk (runtime: main) name-too-long/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{697}< >{753}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, main) name-too-long/async-g.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{697}> <{753}> <{959}> ={581}= [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 165 bytes (javascript) 8.41 KiB (runtime) ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [entry] [rendered] + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 165 bytes (javascript) 8.31 KiB (runtime) ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [entry] [rendered] > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ./a.js 165 bytes [built] [code generated] name-too-long (Rspack x.x.x) compiled successfully custom-chunks-filter: - Entrypoint main 9.51 KiB = custom-chunks-filter/main.js - Entrypoint a 10.2 KiB = custom-chunks-filter/a.js + Entrypoint main 9.4 KiB = custom-chunks-filter/main.js + Entrypoint a 10.1 KiB = custom-chunks-filter/a.js Entrypoint b 6.36 KiB = custom-chunks-filter/418.js 335 bytes custom-chunks-filter/310.js 335 bytes custom-chunks-filter/581.js 335 bytes custom-chunks-filter/753.js 335 bytes custom-chunks-filter/b.js 5.05 KiB Entrypoint c 6.35 KiB = custom-chunks-filter/418.js 335 bytes custom-chunks-filter/416.js 335 bytes custom-chunks-filter/581.js 335 bytes custom-chunks-filter/753.js 335 bytes custom-chunks-filter/c.js 5.05 KiB chunk (runtime: main) custom-chunks-filter/async-c.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] @@ -2108,7 +2108,7 @@ custom-chunks-filter: > ./b b > ./c c ./f.js 20 bytes [built] [code generated] - chunk (runtime: a) custom-chunks-filter/a.js (a) 245 bytes (javascript) 7.34 KiB (runtime) >{581}< >{912}< [entry] [rendered] + chunk (runtime: a) custom-chunks-filter/a.js (a) 245 bytes (javascript) 7.23 KiB (runtime) >{581}< >{912}< [entry] [rendered] > ./a a dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] @@ -2134,8 +2134,8 @@ custom-chunks-filter: custom-chunks-filter (Rspack x.x.x) compiled successfully custom-chunks-filter-in-cache-groups: - Entrypoint main 9.29 KiB = custom-chunks-filter-in-cache-groups/main.js - Entrypoint a 12 KiB = custom-chunks-filter-in-cache-groups/598.js 680 bytes custom-chunks-filter-in-cache-groups/a.js 11.3 KiB + Entrypoint main 9.18 KiB = custom-chunks-filter-in-cache-groups/main.js + Entrypoint a 11.9 KiB = custom-chunks-filter-in-cache-groups/598.js 680 bytes custom-chunks-filter-in-cache-groups/a.js 11.2 KiB Entrypoint b 6.58 KiB = custom-chunks-filter-in-cache-groups/vendors.js 829 bytes custom-chunks-filter-in-cache-groups/b.js 5.78 KiB Entrypoint c 6.58 KiB = custom-chunks-filter-in-cache-groups/vendors.js 829 bytes custom-chunks-filter-in-cache-groups/c.js 5.77 KiB chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-c.js (async-c) 156 bytes <{909}> ={192}= [rendered] @@ -2173,7 +2173,7 @@ custom-chunks-filter-in-cache-groups: ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: a) custom-chunks-filter-in-cache-groups/a.js (a) 205 bytes (javascript) 8.4 KiB (runtime) ={598}= >{912}< [entry] [rendered] + chunk (runtime: a) custom-chunks-filter-in-cache-groups/a.js (a) 205 bytes (javascript) 8.3 KiB (runtime) ={598}= >{912}< [entry] [rendered] > ./a a > x a > y a @@ -2327,7 +2327,7 @@ default (Rspack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-issue-6696 1`] = ` -"Entrypoint main 11 KiB = vendors.js 335 bytes main.js 10.6 KiB +"Entrypoint main 10.9 KiB = vendors.js 335 bytes main.js 10.5 KiB chunk (runtime: main) vendors.js (vendors) (id hint: vendors) 20 bytes ={909}= >{250}< >{262}< [initial] [rendered] split chunk (cache group: vendors) > ./ main ./node_modules/y.js 20 bytes [built] [code generated] @@ -2347,7 +2347,7 @@ default (Rspack x.x.x) compiled successfully" exports[`StatsTestCases should print correct stats for split-chunks-issue-7401 1`] = ` "Entrypoint a 4.9 KiB = 418.js 335 bytes a.js 4.58 KiB -Entrypoint b 8.88 KiB = b.js +Entrypoint b 8.77 KiB = b.js Chunk Group c 701 bytes = 418.js 335 bytes c.js 366 bytes chunk (runtime: a, b) 418.js (id hint: vendors) 20 bytes <{751}> ={74}= ={76}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./c ./b.js 1:0-41 From d005663522c10df8e96f215ab2965c003b25a5f2 Mon Sep 17 00:00:00 2001 From: GiveMe-A-Name Date: Thu, 20 Feb 2025 15:21:40 +0800 Subject: [PATCH 3/3] test: update snapshot --- .../rspack-test-tools/src/processor/stats.ts | 4 +- ...NewCodeSplitting-stats-output.test.js.snap | 128 +- .../__snapshots__/StatsOutput.test.js.snap | 128 +- .../tests/statsAPICases/chunk-group.js | 40 +- .../tests/statsAPICases/chunks.js | 42 +- .../expected/async.$ae2da65b0213ce5b11bb$.css | 4 - .../expected/main.$ae2da65b0213ce5b11bb$.css | 4 - .../chunkFilename-fullhash/expected/main.js | 786 ++++++------ .../cases/issue-6649/expected/main.js | 820 ++++++------ .../webpack-test/StatsTestCases.basictest.js | 6 +- .../ConfigTestCases.basictest.js.snap | 12 - .../StatsTestCases.basictest.js.snap | 1124 ++++++++--------- 12 files changed, 1549 insertions(+), 1549 deletions(-) delete mode 100644 tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/async.$ae2da65b0213ce5b11bb$.css delete mode 100644 tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.$ae2da65b0213ce5b11bb$.css diff --git a/packages/rspack-test-tools/src/processor/stats.ts b/packages/rspack-test-tools/src/processor/stats.ts index 6a82257b67a2..b0104c8b24f6 100644 --- a/packages/rspack-test-tools/src/processor/stats.ts +++ b/packages/rspack-test-tools/src/processor/stats.ts @@ -160,7 +160,9 @@ export class StatsProcessor< actual = actual .replace(/\u001b\[[0-9;]*m/g, "") // CHANGE: The time unit display in Rspack is second - .replace(/[.0-9]+(\s?s)/g, "X$1"); + .replace(/[.0-9]+(\s?s)/g, "X$1") + // CHANGE: Replace bundle size, since bundle sizes may differ between platforms + .replace(/[0-9]+\.?[0-9]+ KiB/g, "xx KiB"); } if (this.snapshotName) { diff --git a/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap index ffd2ef2057ca..6e48c359c1ac 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/NewCodeSplitting-stats-output.test.js.snap @@ -2,10 +2,10 @@ exports[`new code splitting stats output new code splitting stats output/auxiliary-files-test should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` PublicPath: auto -asset bundle.js 2.49 KiB {909} [emitted] (name: main) +asset bundle.js xx KiB {909} [emitted] (name: main) asset 98396dbfd5c74c34.png 7 bytes ({909}) [emitted] [immutable] [from: raw.png] (auxiliary name: main) -Entrypoint main 2.49 KiB (7 bytes) = bundle.js 2.49 KiB (98396dbfd5c74c34.png 7 bytes) -chunk {909} (runtime: main) bundle.js (main) 7 bytes (asset) 159 bytes (javascript) 1.5 KiB (runtime) [entry] [rendered] +Entrypoint main xx KiB (7 bytes) = bundle.js xx KiB (98396dbfd5c74c34.png 7 bytes) +chunk {909} (runtime: main) bundle.js (main) 7 bytes (asset) 159 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./index main ./index.js + 1 modules [686] 117 bytes {909} [depth 0] [code generated] [no exports] @@ -50,8 +50,8 @@ modules by path ./ 235 bytes (javascript) 7 bytes (asset) [exports: default] [no exports used] esm import ./raw.png ./index.js 2:0-33 -runtime modules 1.5 KiB - webpack/runtime/auto_public_path 1.29 KiB {909} [code generated] +runtime modules xx KiB + webpack/runtime/auto_public_path xx KiB {909} [code generated] [no exports] [used exports unknown] webpack/runtime/global 223 bytes {909} [code generated] @@ -85,10 +85,10 @@ Rspack x.x.x compiled successfully in X s `; exports[`new code splitting stats output new code splitting stats output/css-concat should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset main.js 3.67 KiB [emitted] (name: main) +asset main.js xx KiB [emitted] (name: main) asset main.css 24 bytes [emitted] (name: main) -Entrypoint main 3.69 KiB = main.js 3.67 KiB main.css 24 bytes -runtime modules 2.16 KiB 6 modules +Entrypoint main xx KiB = main.js xx KiB main.css 24 bytes +runtime modules xx KiB 6 modules cacheable modules 62 bytes (javascript) 23 bytes (css) ./index.js 20 bytes [built] [code generated] ./foo.css 42 bytes (javascript) 23 bytes (css) [built] [code generated] @@ -96,9 +96,9 @@ Rspack x.x.x compiled successfully in X s `; exports[`new code splitting stats output new code splitting stats output/filename should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset 909.xxxx.js 9.05 KiB [emitted] (name: main) +asset 909.xxxx.js xx KiB [emitted] (name: main) asset 521.xxxx.js 320 bytes [emitted] -runtime modules 7.45 KiB 11 modules +runtime modules xx KiB 11 modules cacheable modules 70 bytes ./index.js 38 bytes [built] [code generated] ./dynamic.js 32 bytes [built] [code generated] @@ -106,8 +106,8 @@ Rspack x.x.x compiled successfully in X s `; exports[`new code splitting stats output new code splitting stats output/hot+production should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset main.js 33.4 KiB [emitted] (name: main) -runtime modules 31.1 KiB 12 modules +asset main.js xx KiB [emitted] (name: main) +runtime modules xx KiB 12 modules ./index.js 25 bytes [built] [code generated] Rspack x.x.x compiled successfully in X s `; @@ -142,25 +142,25 @@ Rspack compiled with 1 error exports[`new code splitting stats output new code splitting stats output/limit-chunk-count-plugin should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` 1 chunks: - asset bundle1.js 3.59 KiB [emitted] (name: main) - chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.78 KiB (runtime) <{909}> >{909}< [entry] [rendered] + asset bundle1.js xx KiB [emitted] (name: main) + chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) xx KiB (runtime) <{909}> >{909}< [entry] [rendered] dependent modules 96 bytes [dependent] 4 modules ./index.js 123 bytes [built] [code generated] 1 chunks (Rspack x.x.x) compiled successfully in X s 2 chunks: - asset bundle2.js 10.5 KiB [emitted] (name: main) + asset bundle2.js xx KiB [emitted] (name: main) asset 76.bundle2.js 491 bytes [emitted] (name: c) chunk (runtime: main) 76.bundle2.js (c) 74 bytes <{76}> <{909}> >{76}< [rendered] dependent modules 44 bytes [dependent] 2 modules ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle2.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle2.js (main) 145 bytes (javascript) xx KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 2 chunks (Rspack x.x.x) compiled successfully in X s 3 chunks: - asset bundle3.js 10.5 KiB [emitted] (name: main) + asset bundle3.js xx KiB [emitted] (name: main) asset 76.bundle3.js 385 bytes [emitted] (name: c) asset 345.bundle3.js 182 bytes [emitted] chunk (runtime: main) 345.bundle3.js 44 bytes <{76}> [rendered] @@ -168,13 +168,13 @@ exports[`new code splitting stats output new code splitting stats output/limit-c ./e.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle3.js (c) 30 bytes <{909}> >{345}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle3.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle3.js (main) 145 bytes (javascript) xx KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 3 chunks (Rspack x.x.x) compiled successfully in X s 4 chunks: - asset bundle4.js 10.5 KiB [emitted] (name: main) + asset bundle4.js xx KiB [emitted] (name: main) asset 76.bundle4.js 385 bytes [emitted] (name: c) asset 697.bundle4.js 128 bytes [emitted] asset 753.bundle4.js 128 bytes [emitted] @@ -184,7 +184,7 @@ exports[`new code splitting stats output new code splitting stats output/limit-c ./d.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle4.js (c) 30 bytes <{909}> >{697}< >{753}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle4.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle4.js (main) 145 bytes (javascript) xx KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 4 chunks (Rspack x.x.x) compiled successfully in X s @@ -225,7 +225,7 @@ Rspack compiled with 2 errors `; exports[`new code splitting stats output new code splitting stats output/named-chunk-group should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -Entrypoint main 9.04 KiB = main.js +Entrypoint main xx KiB = main.js Chunk Group cimanyd 320 bytes = cimanyd.js `; @@ -241,48 +241,48 @@ Rspack compiled with 1 error `; exports[`new code splitting stats output new code splitting stats output/optimization-chunk-ids-natural should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -Entrypoint e1 10.6 KiB = e1.js -Entrypoint e2 10.5 KiB = e2.js +Entrypoint e1 xx KiB = e1.js +Entrypoint e2 xx KiB = e2.js chunk (runtime: e1) 0.js 24 bytes [rendered] chunk (runtime: e1) 1.js 52 bytes [rendered] chunk (runtime: e1, e2) 2.js 22 bytes [rendered] -chunk (runtime: e1) e1.js (e1) 74 bytes (javascript) 8.56 KiB (runtime) [entry] [rendered] -chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) 8.56 KiB (runtime) [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 74 bytes (javascript) xx KiB (runtime) [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) xx KiB (runtime) [entry] [rendered] `; exports[`new code splitting stats output new code splitting stats output/optimization-runtime-chunk should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -Entrypoint e1 4.07 KiB = e1~runtime.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.07 KiB = e2~runtime.js 3.68 KiB e2.js 391 bytes +Entrypoint e1 xx KiB = e1~runtime.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = e2~runtime.js xx KiB e2.js 391 bytes chunk (runtime: e1~runtime) e1.js (e1) 27 bytes [entry] [rendered] -chunk (runtime: e1~runtime) e1~runtime.js (e1~runtime) 2.58 KiB [initial] [rendered] +chunk (runtime: e1~runtime) e1~runtime.js (e1~runtime) xx KiB [initial] [rendered] chunk (runtime: e2~runtime) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: e2~runtime) e2~runtime.js (e2~runtime) 2.58 KiB [initial] [rendered] +chunk (runtime: e2~runtime) e2~runtime.js (e2~runtime) xx KiB [initial] [rendered] `; exports[`new code splitting stats output new code splitting stats output/optimization-runtime-chunk-multiple should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -Entrypoint e1 4.07 KiB = runtime~e1.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.07 KiB = runtime~e2.js 3.68 KiB e2.js 391 bytes +Entrypoint e1 xx KiB = runtime~e1.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = runtime~e2.js xx KiB e2.js 391 bytes chunk (runtime: runtime~e1) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: runtime~e2) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) 2.58 KiB [initial] [rendered] -chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) 2.58 KiB [initial] [rendered] +chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) xx KiB [initial] [rendered] +chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) xx KiB [initial] [rendered] `; exports[`new code splitting stats output new code splitting stats output/optimization-runtime-chunk-single should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -Entrypoint e1 4.06 KiB = runtime.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.06 KiB = runtime.js 3.68 KiB e2.js 391 bytes +Entrypoint e1 xx KiB = runtime.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = runtime.js xx KiB e2.js 391 bytes chunk (runtime: runtime) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: runtime) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: runtime) runtime.js (runtime) 2.58 KiB [initial] [rendered] +chunk (runtime: runtime) runtime.js (runtime) xx KiB [initial] [rendered] `; exports[`new code splitting stats output new code splitting stats output/optimization-runtime-chunk-true should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -Entrypoint e1 4.07 KiB = runtime~e1.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.07 KiB = runtime~e2.js 3.68 KiB e2.js 391 bytes +Entrypoint e1 xx KiB = runtime~e1.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = runtime~e2.js xx KiB e2.js 391 bytes chunk (runtime: runtime~e1) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: runtime~e2) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) 2.58 KiB [initial] [rendered] -chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) 2.58 KiB [initial] [rendered] +chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) xx KiB [initial] [rendered] +chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) xx KiB [initial] [rendered] `; exports[`new code splitting stats output new code splitting stats output/parse-error should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` @@ -305,14 +305,14 @@ Rspack compiled with 1 error `; exports[`new code splitting stats output new code splitting stats output/performance-disabled should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset main.js 304 KiB [emitted] (name: main) +asset main.js xx KiB [emitted] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] -Entrypoint main 304 KiB = main.js -runtime modules 8.56 KiB 12 modules -cacheable modules 293 KiB +Entrypoint main xx KiB = main.js +runtime modules xx KiB 12 modules +cacheable modules xx KiB ./index.js 49 bytes [built] [code generated] - ./a.js 293 KiB [built] [code generated] + ./a.js xx KiB [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 28 bytes [built] [code generated] ./d.js 22 bytes [built] [code generated] @@ -321,25 +321,25 @@ Rspack x.x.x compiled successfully in X s `; exports[`new code splitting stats output new code splitting stats output/performance-error should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset main.js 304 KiB [emitted] [big] (name: main) +asset main.js xx KiB [emitted] [big] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] -Entrypoint main [big] 304 KiB = main.js -runtime modules 8.56 KiB 12 modules -cacheable modules 293 KiB +Entrypoint main [big] xx KiB = main.js +runtime modules xx KiB 12 modules +cacheable modules xx KiB ./index.js 48 bytes [built] [code generated] - ./a.js 293 KiB [built] [code generated] + ./a.js xx KiB [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 28 bytes [built] [code generated] ./d.js 22 bytes [built] [code generated] ./e.js 22 bytes [built] [code generated] -ERROR in × asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance.Assets: - │ main.js (303.652 KiB) +ERROR in × asset size limit: The following asset(s) exceed the recommended size limit (xx KiB). This can impact web performance.Assets: + │ main.js (xx KiB) -ERROR in × entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance.Entrypoints: - │ main (303.652 KiB) +ERROR in × entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (xx KiB). This can impact web performance.Entrypoints: + │ main (xx KiB) │ main.js @@ -347,14 +347,14 @@ Rspack x.x.x compiled with 2 errors in X s `; exports[`new code splitting stats output new code splitting stats output/performance-no-hints should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset main.js 304 KiB [emitted] [big] (name: main) +asset main.js xx KiB [emitted] [big] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] -Entrypoint main [big] 304 KiB = main.js -runtime modules 8.56 KiB 12 modules -cacheable modules 293 KiB +Entrypoint main [big] xx KiB = main.js +runtime modules xx KiB 12 modules +cacheable modules xx KiB ./index.js 48 bytes [built] [code generated] - ./a.js 293 KiB [built] [code generated] + ./a.js xx KiB [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 28 bytes [built] [code generated] ./d.js 22 bytes [built] [code generated] @@ -373,7 +373,7 @@ chunk (runtime: main) a2.js (a2) 1 bytes <{74}> [rendered] chunk (runtime: main) b.js (b) 203 bytes <{909}> >{438}< >{439}< >{826}< (prefetch: {826} {438}) (preload: {439}) [rendered] chunk (runtime: main) c.js (c) 134 bytes <{909}> >{380}< >{433}< (preload: {433} {380}) [rendered] chunk (runtime: main) b1.js (b1) 1 bytes <{751}> [rendered] -chunk (runtime: main) main.js (main) 195 bytes (javascript) 11.8 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered] +chunk (runtime: main) main.js (main) 195 bytes (javascript) xx KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered] `; exports[`new code splitting stats output new code splitting stats output/reasons should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` @@ -401,7 +401,7 @@ Rspack x.x.x compiled with 1 error in X s `; exports[`new code splitting stats output new code splitting stats output/resolve-unexpected-exports-in-pkg-error should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset bundle.js 1.38 KiB [emitted] (name: main) +asset bundle.js xx KiB [emitted] (name: main) runtime modules 280 bytes 1 module ./index.js 39 bytes [built] [code generated] [1 error] @@ -419,7 +419,7 @@ webpack/runtime/make_namespace_object 280 bytes [code generated] `; exports[`new code splitting stats output new code splitting stats output/runtime-specific-exports should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset main.js 1.79 KiB [emitted] (name: main) +asset main.js xx KiB [emitted] (name: main) ./example.js 70 bytes [built] [code generated] [no exports used] ./increment.js 251 bytes [built] [code generated] @@ -444,14 +444,14 @@ Rspack x.x.x compiled successfully in X s `; exports[`new code splitting stats output new code splitting stats output/simple-export should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset bundle.js 1.69 KiB [emitted] (name: main) +asset bundle.js xx KiB [emitted] (name: main) runtime modules 677 bytes 3 modules ./index.js 26 bytes [built] [code generated] Rspack x.x.x compiled successfully in X s `; exports[`new code splitting stats output new code splitting stats output/simple-module-source should print correct stats for: NewCodeSplittingStatsOutput 1`] = ` -asset bundle.js 2.06 KiB [emitted] (name: main) +asset bundle.js xx KiB [emitted] (name: main) runtime modules 702 bytes 3 modules orphan modules 1 bytes [orphan] 1 module cacheable modules 82 bytes diff --git a/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap index 6799c1e8cca2..0e2ead25f8a0 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap @@ -2,10 +2,10 @@ exports[`statsOutput statsOutput/auxiliary-files-test should print correct stats for 1`] = ` PublicPath: auto -asset bundle.js 2.49 KiB {909} [emitted] (name: main) +asset bundle.js xx KiB {909} [emitted] (name: main) asset 98396dbfd5c74c34.png 7 bytes ({909}) [emitted] [immutable] [from: raw.png] (auxiliary name: main) -Entrypoint main 2.49 KiB (7 bytes) = bundle.js 2.49 KiB (98396dbfd5c74c34.png 7 bytes) -chunk {909} (runtime: main) bundle.js (main) 7 bytes (asset) 159 bytes (javascript) 1.5 KiB (runtime) [entry] [rendered] +Entrypoint main xx KiB (7 bytes) = bundle.js xx KiB (98396dbfd5c74c34.png 7 bytes) +chunk {909} (runtime: main) bundle.js (main) 7 bytes (asset) 159 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./index main ./index.js + 1 modules [686] 117 bytes {909} [depth 0] [code generated] [no exports] @@ -50,8 +50,8 @@ modules by path ./ 235 bytes (javascript) 7 bytes (asset) [exports: default] [no exports used] esm import ./raw.png ./index.js 2:0-33 -runtime modules 1.5 KiB - webpack/runtime/auto_public_path 1.29 KiB {909} [code generated] +runtime modules xx KiB + webpack/runtime/auto_public_path xx KiB {909} [code generated] [no exports] [used exports unknown] webpack/runtime/global 223 bytes {909} [code generated] @@ -85,10 +85,10 @@ Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/css-concat should print correct stats for 1`] = ` -asset main.js 3.67 KiB [emitted] (name: main) +asset main.js xx KiB [emitted] (name: main) asset main.css 24 bytes [emitted] (name: main) -Entrypoint main 3.69 KiB = main.js 3.67 KiB main.css 24 bytes -runtime modules 2.16 KiB 6 modules +Entrypoint main xx KiB = main.js xx KiB main.css 24 bytes +runtime modules xx KiB 6 modules cacheable modules 62 bytes (javascript) 23 bytes (css) ./index.js 20 bytes [built] [code generated] ./foo.css 42 bytes (javascript) 23 bytes (css) [built] [code generated] @@ -96,9 +96,9 @@ Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/filename should print correct stats for 1`] = ` -asset 909.xxxx.js 9.05 KiB [emitted] (name: main) +asset 909.xxxx.js xx KiB [emitted] (name: main) asset 521.xxxx.js 320 bytes [emitted] -runtime modules 7.45 KiB 11 modules +runtime modules xx KiB 11 modules cacheable modules 70 bytes ./index.js 38 bytes [built] [code generated] ./dynamic.js 32 bytes [built] [code generated] @@ -106,8 +106,8 @@ Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/hot+production should print correct stats for 1`] = ` -asset main.js 33.4 KiB [emitted] (name: main) -runtime modules 31.1 KiB 12 modules +asset main.js xx KiB [emitted] (name: main) +runtime modules xx KiB 12 modules ./index.js 25 bytes [built] [code generated] Rspack x.x.x compiled successfully in X s `; @@ -142,25 +142,25 @@ Rspack compiled with 1 error exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct stats for 1`] = ` 1 chunks: - asset bundle1.js 3.59 KiB [emitted] (name: main) - chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.78 KiB (runtime) <{909}> >{909}< [entry] [rendered] + asset bundle1.js xx KiB [emitted] (name: main) + chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) xx KiB (runtime) <{909}> >{909}< [entry] [rendered] dependent modules 96 bytes [dependent] 4 modules ./index.js 123 bytes [built] [code generated] 1 chunks (Rspack x.x.x) compiled successfully in X s 2 chunks: - asset bundle2.js 10.5 KiB [emitted] (name: main) + asset bundle2.js xx KiB [emitted] (name: main) asset 76.bundle2.js 491 bytes [emitted] (name: c) chunk (runtime: main) 76.bundle2.js (c) 74 bytes <{76}> <{909}> >{76}< [rendered] dependent modules 44 bytes [dependent] 2 modules ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle2.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle2.js (main) 145 bytes (javascript) xx KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 2 chunks (Rspack x.x.x) compiled successfully in X s 3 chunks: - asset bundle3.js 10.5 KiB [emitted] (name: main) + asset bundle3.js xx KiB [emitted] (name: main) asset 76.bundle3.js 385 bytes [emitted] (name: c) asset 345.bundle3.js 182 bytes [emitted] chunk (runtime: main) 345.bundle3.js 44 bytes <{76}> [rendered] @@ -168,13 +168,13 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s ./e.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle3.js (c) 30 bytes <{909}> >{345}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle3.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle3.js (main) 145 bytes (javascript) xx KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 3 chunks (Rspack x.x.x) compiled successfully in X s 4 chunks: - asset bundle4.js 10.5 KiB [emitted] (name: main) + asset bundle4.js xx KiB [emitted] (name: main) asset 76.bundle4.js 385 bytes [emitted] (name: c) asset 697.bundle4.js 128 bytes [emitted] asset 753.bundle4.js 128 bytes [emitted] @@ -184,7 +184,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s ./d.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle4.js (c) 30 bytes <{909}> >{697}< >{753}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle4.js (main) 145 bytes (javascript) 8.57 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle4.js (main) 145 bytes (javascript) xx KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] 4 chunks (Rspack x.x.x) compiled successfully in X s @@ -225,7 +225,7 @@ Rspack compiled with 2 errors `; exports[`statsOutput statsOutput/named-chunk-group should print correct stats for 1`] = ` -Entrypoint main 9.04 KiB = main.js +Entrypoint main xx KiB = main.js Chunk Group cimanyd 320 bytes = cimanyd.js `; @@ -241,48 +241,48 @@ Rspack compiled with 1 error `; exports[`statsOutput statsOutput/optimization-chunk-ids-natural should print correct stats for 1`] = ` -Entrypoint e1 10.6 KiB = e1.js -Entrypoint e2 10.5 KiB = e2.js +Entrypoint e1 xx KiB = e1.js +Entrypoint e2 xx KiB = e2.js chunk (runtime: e1) 0.js 24 bytes [rendered] chunk (runtime: e1) 1.js 52 bytes [rendered] chunk (runtime: e1, e2) 2.js 22 bytes [rendered] -chunk (runtime: e1) e1.js (e1) 74 bytes (javascript) 8.56 KiB (runtime) [entry] [rendered] -chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) 8.56 KiB (runtime) [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 74 bytes (javascript) xx KiB (runtime) [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) xx KiB (runtime) [entry] [rendered] `; exports[`statsOutput statsOutput/optimization-runtime-chunk should print correct stats for 1`] = ` -Entrypoint e1 4.07 KiB = e1~runtime.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.07 KiB = e2~runtime.js 3.68 KiB e2.js 391 bytes +Entrypoint e1 xx KiB = e1~runtime.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = e2~runtime.js xx KiB e2.js 391 bytes chunk (runtime: e1~runtime) e1.js (e1) 27 bytes [entry] [rendered] -chunk (runtime: e1~runtime) e1~runtime.js (e1~runtime) 2.58 KiB [initial] [rendered] +chunk (runtime: e1~runtime) e1~runtime.js (e1~runtime) xx KiB [initial] [rendered] chunk (runtime: e2~runtime) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: e2~runtime) e2~runtime.js (e2~runtime) 2.58 KiB [initial] [rendered] +chunk (runtime: e2~runtime) e2~runtime.js (e2~runtime) xx KiB [initial] [rendered] `; exports[`statsOutput statsOutput/optimization-runtime-chunk-multiple should print correct stats for 1`] = ` -Entrypoint e1 4.07 KiB = runtime~e1.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.07 KiB = runtime~e2.js 3.68 KiB e2.js 391 bytes +Entrypoint e1 xx KiB = runtime~e1.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = runtime~e2.js xx KiB e2.js 391 bytes chunk (runtime: runtime~e1) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: runtime~e2) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) 2.58 KiB [initial] [rendered] -chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) 2.58 KiB [initial] [rendered] +chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) xx KiB [initial] [rendered] +chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) xx KiB [initial] [rendered] `; exports[`statsOutput statsOutput/optimization-runtime-chunk-single should print correct stats for 1`] = ` -Entrypoint e1 4.06 KiB = runtime.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.06 KiB = runtime.js 3.68 KiB e2.js 391 bytes +Entrypoint e1 xx KiB = runtime.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = runtime.js xx KiB e2.js 391 bytes chunk (runtime: runtime) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: runtime) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: runtime) runtime.js (runtime) 2.58 KiB [initial] [rendered] +chunk (runtime: runtime) runtime.js (runtime) xx KiB [initial] [rendered] `; exports[`statsOutput statsOutput/optimization-runtime-chunk-true should print correct stats for 1`] = ` -Entrypoint e1 4.07 KiB = runtime~e1.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.07 KiB = runtime~e2.js 3.68 KiB e2.js 391 bytes +Entrypoint e1 xx KiB = runtime~e1.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = runtime~e2.js xx KiB e2.js 391 bytes chunk (runtime: runtime~e1) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: runtime~e2) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) 2.58 KiB [initial] [rendered] -chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) 2.58 KiB [initial] [rendered] +chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) xx KiB [initial] [rendered] +chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) xx KiB [initial] [rendered] `; exports[`statsOutput statsOutput/parse-error should print correct stats for 1`] = ` @@ -305,14 +305,14 @@ Rspack compiled with 1 error `; exports[`statsOutput statsOutput/performance-disabled should print correct stats for 1`] = ` -asset main.js 304 KiB [emitted] (name: main) +asset main.js xx KiB [emitted] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] -Entrypoint main 304 KiB = main.js -runtime modules 8.56 KiB 12 modules -cacheable modules 293 KiB +Entrypoint main xx KiB = main.js +runtime modules xx KiB 12 modules +cacheable modules xx KiB ./index.js 49 bytes [built] [code generated] - ./a.js 293 KiB [built] [code generated] + ./a.js xx KiB [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 28 bytes [built] [code generated] ./d.js 22 bytes [built] [code generated] @@ -321,25 +321,25 @@ Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/performance-error should print correct stats for 1`] = ` -asset main.js 304 KiB [emitted] [big] (name: main) +asset main.js xx KiB [emitted] [big] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] -Entrypoint main [big] 304 KiB = main.js -runtime modules 8.56 KiB 12 modules -cacheable modules 293 KiB +Entrypoint main [big] xx KiB = main.js +runtime modules xx KiB 12 modules +cacheable modules xx KiB ./index.js 48 bytes [built] [code generated] - ./a.js 293 KiB [built] [code generated] + ./a.js xx KiB [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 28 bytes [built] [code generated] ./d.js 22 bytes [built] [code generated] ./e.js 22 bytes [built] [code generated] -ERROR in × asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance.Assets: - │ main.js (303.652 KiB) +ERROR in × asset size limit: The following asset(s) exceed the recommended size limit (xx KiB). This can impact web performance.Assets: + │ main.js (xx KiB) -ERROR in × entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance.Entrypoints: - │ main (303.652 KiB) +ERROR in × entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (xx KiB). This can impact web performance.Entrypoints: + │ main (xx KiB) │ main.js @@ -347,14 +347,14 @@ Rspack x.x.x compiled with 2 errors in X s `; exports[`statsOutput statsOutput/performance-no-hints should print correct stats for 1`] = ` -asset main.js 304 KiB [emitted] [big] (name: main) +asset main.js xx KiB [emitted] [big] (name: main) asset 697.js 128 bytes [emitted] asset 753.js 128 bytes [emitted] -Entrypoint main [big] 304 KiB = main.js -runtime modules 8.56 KiB 12 modules -cacheable modules 293 KiB +Entrypoint main [big] xx KiB = main.js +runtime modules xx KiB 12 modules +cacheable modules xx KiB ./index.js 48 bytes [built] [code generated] - ./a.js 293 KiB [built] [code generated] + ./a.js xx KiB [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 28 bytes [built] [code generated] ./d.js 22 bytes [built] [code generated] @@ -373,7 +373,7 @@ chunk (runtime: main) a2.js (a2) 1 bytes <{74}> [rendered] chunk (runtime: main) b.js (b) 203 bytes <{909}> >{438}< >{439}< >{826}< (prefetch: {826} {438}) (preload: {439}) [rendered] chunk (runtime: main) c.js (c) 134 bytes <{909}> >{380}< >{433}< (preload: {433} {380}) [rendered] chunk (runtime: main) b1.js (b1) 1 bytes <{751}> [rendered] -chunk (runtime: main) main.js (main) 195 bytes (javascript) 11.8 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered] +chunk (runtime: main) main.js (main) 195 bytes (javascript) xx KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered] `; exports[`statsOutput statsOutput/reasons should print correct stats for 1`] = ` @@ -401,7 +401,7 @@ Rspack x.x.x compiled with 1 error in X s `; exports[`statsOutput statsOutput/resolve-unexpected-exports-in-pkg-error should print correct stats for 1`] = ` -asset bundle.js 1.38 KiB [emitted] (name: main) +asset bundle.js xx KiB [emitted] (name: main) runtime modules 280 bytes 1 module ./index.js 39 bytes [built] [code generated] [1 error] @@ -419,7 +419,7 @@ webpack/runtime/make_namespace_object 280 bytes [code generated] `; exports[`statsOutput statsOutput/runtime-specific-exports should print correct stats for 1`] = ` -asset main.js 1.79 KiB [emitted] (name: main) +asset main.js xx KiB [emitted] (name: main) ./example.js 70 bytes [built] [code generated] [no exports used] ./increment.js 251 bytes [built] [code generated] @@ -444,14 +444,14 @@ Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/simple-export should print correct stats for 1`] = ` -asset bundle.js 1.69 KiB [emitted] (name: main) +asset bundle.js xx KiB [emitted] (name: main) runtime modules 677 bytes 3 modules ./index.js 26 bytes [built] [code generated] Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/simple-module-source should print correct stats for 1`] = ` -asset bundle.js 2.06 KiB [emitted] (name: main) +asset bundle.js xx KiB [emitted] (name: main) runtime modules 702 bytes 3 modules orphan modules 1 bytes [orphan] 1 module cacheable modules 82 bytes diff --git a/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js b/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js index b1b1a6b81a1f..6511a85fac23 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js +++ b/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js @@ -1,3 +1,20 @@ +function deepReplaceNumbers(obj) { + if (typeof obj === "object" && obj !== null) { + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + if ( + typeof obj[key] === "number" && + (key.includes("size") || key.includes("Size")) + ) { + obj[key] = "xxx"; + } else if (typeof obj[key] === "object") { + deepReplaceNumbers(obj[key]); + } + } + } + } +} + /** @type {import('../..').TStatsAPICaseConfig} */ module.exports = { description: "should generate chunk group asset", @@ -20,23 +37,28 @@ module.exports = { builtAt: false, version: false }; - expect(stats?.toJson(statsOptions).entrypoints).toMatchInlineSnapshot(` + + const entrypoints = stats?.toJson(statsOptions).entrypoints; + + deepReplaceNumbers(entrypoints); + + expect(entrypoints).toMatchInlineSnapshot(` Object { main: Object { assets: Array [ Object { name: main.js, - size: 14283, + size: xxx, }, ], - assetsSize: 14283, + assetsSize: xxx, auxiliaryAssets: Array [ Object { name: main.js.map, - size: 684, + size: xxx, }, ], - auxiliaryAssetsSize: 684, + auxiliaryAssetsSize: xxx, childAssets: Object {}, children: Object { prefetch: Array [ @@ -44,17 +66,17 @@ module.exports = { assets: Array [ Object { name: chunk.js, - size: 841, + size: xxx, }, ], - assetsSize: 841, + assetsSize: xxx, auxiliaryAssets: Array [ Object { name: chunk.js.map, - size: 514, + size: xxx, }, ], - auxiliaryAssetsSize: 514, + auxiliaryAssetsSize: xxx, chunks: Array [ 919, ], diff --git a/packages/rspack-test-tools/tests/statsAPICases/chunks.js b/packages/rspack-test-tools/tests/statsAPICases/chunks.js index 0219c173ef73..dcd44028635c 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/chunks.js +++ b/packages/rspack-test-tools/tests/statsAPICases/chunks.js @@ -1,3 +1,19 @@ +function deepReplace(obj) { + if (typeof obj === "object" && obj !== null) { + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + if (typeof obj[key] === "number" && key === "runtime") { + obj[key] = "xxx"; + } else if (key === "hash") { + obj[key] = "xxxxxxxxxxxxxxxx"; + } else if (typeof obj[key] === "object") { + deepReplace(obj[key]); + } + } + } + } +} + /** @type {import('../../dist').TStatsAPICaseConfig} */ module.exports = { description: "should output the chunks", @@ -8,15 +24,17 @@ module.exports = { }; }, async check(stats) { - expect( - stats?.toJson({ - chunks: true, - timings: false, - builtAt: false, - version: false, - modulesSpace: 3 - }).chunks - ).toMatchInlineSnapshot(` + const statsChunks = stats?.toJson({ + chunks: true, + timings: false, + builtAt: false, + version: false, + modulesSpace: 3 + }).chunks; + + deepReplace(statsChunks); + + expect(statsChunks).toMatchInlineSnapshot(` Array [ Object { auxiliaryFiles: Array [], @@ -27,7 +45,7 @@ module.exports = { chunkB.js, ], filteredModules: undefined, - hash: 64feb0c0aec6d474, + hash: xxxxxxxxxxxxxxxx, id: 250, idHints: Array [], initial: false, @@ -150,7 +168,7 @@ module.exports = { main.js, ], filteredModules: undefined, - hash: f284da740ad9a1cb, + hash: xxxxxxxxxxxxxxxx, id: 909, idHints: Array [], initial: true, @@ -247,7 +265,7 @@ module.exports = { size: 85, sizes: Object { javascript: 85, - runtime: 8965, + runtime: xxx, }, type: chunk, }, diff --git a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/async.$ae2da65b0213ce5b11bb$.css b/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/async.$ae2da65b0213ce5b11bb$.css deleted file mode 100644 index e665100accf4..000000000000 --- a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/async.$ae2da65b0213ce5b11bb$.css +++ /dev/null @@ -1,4 +0,0 @@ -.async { - color: red; -} - diff --git a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.$ae2da65b0213ce5b11bb$.css b/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.$ae2da65b0213ce5b11bb$.css deleted file mode 100644 index cebc5c1c9f8a..000000000000 --- a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.$ae2da65b0213ce5b11bb$.css +++ /dev/null @@ -1,4 +0,0 @@ -body { - background: red; -} - diff --git a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.js b/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.js index abdccc7ae0e1..7798916dcf89 100644 --- a/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.js +++ b/tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.js @@ -1,412 +1,412 @@ (() => { // webpackBootstrap - "use strict"; - var __webpack_modules__ = ({ - "./style.css": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { - __webpack_require__.r(__webpack_exports__); - // extracted by css-extract-rspack-plugin - - +"use strict"; +var __webpack_modules__ = ({ +"./style.css": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { +__webpack_require__.r(__webpack_exports__); +// extracted by css-extract-rspack-plugin + + +}), + +}); +/************************************************************************/ +// The module cache +var __webpack_module_cache__ = {}; + +// The require function +function __webpack_require__(moduleId) { + +// Check if module is in cache +var cachedModule = __webpack_module_cache__[moduleId]; +if (cachedModule !== undefined) { +return cachedModule.exports; +} +// Create a new module (and put it into the cache) +var module = (__webpack_module_cache__[moduleId] = { +exports: {} +}); +// Execute the module function +__webpack_modules__[moduleId](module, module.exports, __webpack_require__); + +// Return the exports of the module +return module.exports; + +} + +// expose the modules object (__webpack_modules__) +__webpack_require__.m = __webpack_modules__; + +/************************************************************************/ +// webpack/runtime/ensure_chunk +(() => { +__webpack_require__.f = {}; +// This file contains only the entry chunk. +// The chunk loading function for additional chunks +__webpack_require__.e = function (chunkId) { + return Promise.all( + Object.keys(__webpack_require__.f).reduce(function (promises, key) { + __webpack_require__.f[key](chunkId, promises); + return promises; + }, []) + ); +}; + +})(); +// webpack/runtime/get javascript chunk filename +(() => { +// This function allow to reference chunks + __webpack_require__.u = function (chunkId) { + // return url for filenames not based on template + + // return url for filenames based on template + return "" + chunkId + ".js"; + }; + +})(); +// webpack/runtime/get mini-css chunk filename +(() => { +// This function allow to reference chunks + __webpack_require__.miniCssF = function (chunkId) { + // return url for filenames not based on template + + // return url for filenames based on template + return "" + chunkId + ".$" + __webpack_require__.h() + "$.css"; + }; + +})(); +// webpack/runtime/get_full_hash +(() => { +__webpack_require__.h = function () { + return "__FULL_HASH__"; +}; + +})(); +// webpack/runtime/global +(() => { +__webpack_require__.g = (function () { + if (typeof globalThis === 'object') return globalThis; + try { + return this || new Function('return this')(); + } catch (e) { + if (typeof window === 'object') return window; + } +})(); + +})(); +// webpack/runtime/has_own_property +(() => { +__webpack_require__.o = function (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +})(); +// webpack/runtime/load_script +(() => { +var inProgress = {}; + + +// loadScript function to load a script via script tag +__webpack_require__.l = function (url, done, key, chunkId) { + if (inProgress[url]) { + inProgress[url].push(done); + return; + } + var script, needAttach; + if (key !== undefined) { + var scripts = document.getElementsByTagName("script"); + for (var i = 0; i < scripts.length; i++) { + var s = scripts[i]; + if (s.getAttribute("src") == url) { + script = s; + break; + } + } + } + if (!script) { + needAttach = true; + + script = document.createElement('script'); + + script.charset = 'utf-8'; + script.timeout = 120; + if (__webpack_require__.nc) { + script.setAttribute("nonce", __webpack_require__.nc); + } + + + script.src = url; + + + } + inProgress[url] = [done]; + var onScriptComplete = function (prev, event) { + script.onerror = script.onload = null; + clearTimeout(timeout); + var doneFns = inProgress[url]; + delete inProgress[url]; + script.parentNode && script.parentNode.removeChild(script); + doneFns && + doneFns.forEach(function (fn) { + return fn(event); + }); + if (prev) return prev(event); + }; + var timeout = setTimeout( + onScriptComplete.bind(null, undefined, { + type: 'timeout', + target: script }), - - }); - /************************************************************************/ - // The module cache - var __webpack_module_cache__ = {}; - - // The require function - function __webpack_require__(moduleId) { - - // Check if module is in cache - var cachedModule = __webpack_module_cache__[moduleId]; - if (cachedModule !== undefined) { - return cachedModule.exports; + 120000 + ); + script.onerror = onScriptComplete.bind(null, script.onerror); + script.onload = onScriptComplete.bind(null, script.onload); + needAttach && document.head.appendChild(script); +}; + +})(); +// webpack/runtime/make_namespace_object +(() => { +// define __esModule on exports +__webpack_require__.r = function(exports) { + if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { + Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + } + Object.defineProperty(exports, '__esModule', { value: true }); +}; + +})(); +// webpack/runtime/auto_public_path +(() => { +var scriptUrl; + +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} + +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl +})(); +// webpack/runtime/css loading +(() => { +if (typeof document === "undefined") return; +var createStylesheet = function ( + chunkId, fullhref, oldTag, resolve, reject +) { + var linkTag = document.createElement("link"); + + linkTag.rel = "stylesheet"; + linkTag.type="text/css"; + if (__webpack_require__.nc) { + linkTag.nonce = __webpack_require__.nc; + } + var onLinkComplete = function (event) { + // avoid mem leaks. + linkTag.onerror = linkTag.onload = null; + if (event.type === 'load') { + resolve(); + } else { + var errorType = event && (event.type === 'load' ? 'missing' : event.type); + var realHref = event && event.target && event.target.href || fullhref; + var err = new Error("Loading CSS chunk " + chunkId + " failed.\\n(" + realHref + ")"); + err.code = "CSS_CHUNK_LOAD_FAILED"; + err.type = errorType; + err.request = realHref; + if (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag) + reject(err); } - // Create a new module (and put it into the cache) - var module = (__webpack_module_cache__[moduleId] = { - exports: {} - }); - // Execute the module function - __webpack_modules__[moduleId](module, module.exports, __webpack_require__); - - // Return the exports of the module - return module.exports; + } + linkTag.onerror = linkTag.onload = onLinkComplete; + linkTag.href = fullhref; + + if (oldTag) { + oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling); +} else { + document.head.appendChild(linkTag); +} + return linkTag; +} +var findStylesheet = function (href, fullhref) { + var existingLinkTags = document.getElementsByTagName("link"); + for (var i = 0; i < existingLinkTags.length; i++) { + var tag = existingLinkTags[i]; + var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); + if (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag; } - // expose the modules object (__webpack_modules__) - __webpack_require__.m = __webpack_modules__; - - /************************************************************************/ - // webpack/runtime/ensure_chunk - (() => { - __webpack_require__.f = {}; - // This file contains only the entry chunk. - // The chunk loading function for additional chunks - __webpack_require__.e = function (chunkId) { - return Promise.all( - Object.keys(__webpack_require__.f).reduce(function (promises, key) { - __webpack_require__.f[key](chunkId, promises); - return promises; - }, []) - ); - }; - - })(); - // webpack/runtime/get javascript chunk filename - (() => { - // This function allow to reference chunks - __webpack_require__.u = function (chunkId) { - // return url for filenames not based on template - - // return url for filenames based on template - return "" + chunkId + ".js"; - }; - - })(); - // webpack/runtime/get mini-css chunk filename - (() => { - // This function allow to reference chunks - __webpack_require__.miniCssF = function (chunkId) { - // return url for filenames not based on template - - // return url for filenames based on template - return "" + chunkId + ".$" + __webpack_require__.h() + "$.css"; - }; - - })(); - // webpack/runtime/get_full_hash - (() => { - __webpack_require__.h = function () { - return "__FULL_HASH__"; - }; - - })(); - // webpack/runtime/global - (() => { - __webpack_require__.g = (function () { - if (typeof globalThis === 'object') return globalThis; - try { - return this || new Function('return this')(); - } catch (e) { - if (typeof window === 'object') return window; - } - })(); - - })(); - // webpack/runtime/has_own_property - (() => { - __webpack_require__.o = function (obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); - }; - - })(); - // webpack/runtime/load_script - (() => { - var inProgress = {}; - - - // loadScript function to load a script via script tag - __webpack_require__.l = function (url, done, key, chunkId) { - if (inProgress[url]) { - inProgress[url].push(done); - return; - } - var script, needAttach; - if (key !== undefined) { - var scripts = document.getElementsByTagName("script"); - for (var i = 0; i < scripts.length; i++) { - var s = scripts[i]; - if (s.getAttribute("src") == url) { - script = s; - break; - } + var existingStyleTags = document.getElementsByTagName("style"); + for (var i = 0; i < existingStyleTags.length; i++) { + var tag = existingStyleTags[i]; + var dataHref = tag.getAttribute("data-href"); + if (dataHref === href || dataHref === fullhref) return tag; + } +} + +var loadStylesheet = function (chunkId) { + return new Promise(function (resolve, reject) { + var href = __webpack_require__.miniCssF(chunkId); + var fullhref = __webpack_require__.p + href; + if (findStylesheet(href, fullhref)) return resolve(); + createStylesheet(chunkId, fullhref, null, resolve, reject); + }) +} + +// object to store loaded CSS chunks +var installedCssChunks = { + "main": 0, + +}; + +__webpack_require__.f.miniCss = function(chunkId, promises) { + var cssChunks = { +"async": 1, + +}; + if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]) + else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) + promises.push( + installedCssChunks[chunkId] = loadStylesheet(chunkId).then( + function() { + installedCssChunks[chunkId] = 0; + }, + function(e) { + delete installedCssChunks[chunkId]; + throw e; } - } - if (!script) { - needAttach = true; - - script = document.createElement('script'); - - script.charset = 'utf-8'; - script.timeout = 120; - if (__webpack_require__.nc) { - script.setAttribute("nonce", __webpack_require__.nc); + ) + ) +} + +// no hmr + +})(); +// webpack/runtime/jsonp_chunk_loading +(() => { + + // object to store loaded and loading chunks + // undefined = chunk not loaded, null = chunk preloaded/prefetched + // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded + var installedChunks = {"main": 0,}; + + __webpack_require__.f.j = function (chunkId, promises) { + // JSONP chunk loading for javascript +var installedChunkData = __webpack_require__.o(installedChunks, chunkId) + ? installedChunks[chunkId] + : undefined; +if (installedChunkData !== 0) { + // 0 means "already installed". + + // a Promise means "currently loading". + if (installedChunkData) { + promises.push(installedChunkData[2]); + } else { + if (true) { + // setup Promise in chunk cache + var promise = new Promise(function (resolve, reject) { + installedChunkData = installedChunks[chunkId] = [resolve, reject]; + }); + promises.push((installedChunkData[2] = promise)); + + // start chunk loading + var url = __webpack_require__.p + __webpack_require__.u(chunkId); + // create error before stack unwound to get useful stacktrace later + var error = new Error(); + var loadingEnded = function (event) { + if (__webpack_require__.o(installedChunks, chunkId)) { + installedChunkData = installedChunks[chunkId]; + if (installedChunkData !== 0) installedChunks[chunkId] = undefined; + if (installedChunkData) { + var errorType = + event && (event.type === 'load' ? 'missing' : event.type); + var realSrc = event && event.target && event.target.src; + error.message = + 'Loading chunk ' + + chunkId + + ' failed.\n(' + + errorType + + ': ' + + realSrc + + ')'; + error.name = 'ChunkLoadError'; + error.type = errorType; + error.request = realSrc; + installedChunkData[1](error); + } } - - - script.src = url; - - - } - inProgress[url] = [done]; - var onScriptComplete = function (prev, event) { - script.onerror = script.onload = null; - clearTimeout(timeout); - var doneFns = inProgress[url]; - delete inProgress[url]; - script.parentNode && script.parentNode.removeChild(script); - doneFns && - doneFns.forEach(function (fn) { - return fn(event); - }); - if (prev) return prev(event); }; - var timeout = setTimeout( - onScriptComplete.bind(null, undefined, { - type: 'timeout', - target: script - }), - 120000 - ); - script.onerror = onScriptComplete.bind(null, script.onerror); - script.onload = onScriptComplete.bind(null, script.onload); - needAttach && document.head.appendChild(script); - }; - - })(); - // webpack/runtime/make_namespace_object - (() => { - // define __esModule on exports - __webpack_require__.r = function (exports) { - if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { - Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - } - Object.defineProperty(exports, '__esModule', { value: true }); - }; - - })(); - // webpack/runtime/auto_public_path - (() => { - var scriptUrl; - - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } + __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); + } + } +} + + } + // install a JSONP callback for chunk loading +var webpackJsonpCallback = function (parentChunkLoadingFunction, data) { + var chunkIds = data[0]; + var moreModules = data[1]; + var runtime = data[2]; + // add "moreModules" to the modules object, + // then flag all "chunkIds" as loaded and fire callback + var moduleId, + chunkId, + i = 0; + if (chunkIds.some(function (id) { return installedChunks[id] !== 0 })) { + for (moduleId in moreModules) { + if (__webpack_require__.o(moreModules, moduleId)) { + __webpack_require__.m[moduleId] = moreModules[moduleId]; } } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - })(); - // webpack/runtime/css loading - (() => { - if (typeof document === "undefined") return; - var createStylesheet = function ( - chunkId, fullhref, oldTag, resolve, reject + if (runtime) var result = runtime(__webpack_require__); + } + if (parentChunkLoadingFunction) parentChunkLoadingFunction(data); + for (; i < chunkIds.length; i++) { + chunkId = chunkIds[i]; + if ( + __webpack_require__.o(installedChunks, chunkId) && + installedChunks[chunkId] ) { - var linkTag = document.createElement("link"); - - linkTag.rel = "stylesheet"; - linkTag.type = "text/css"; - if (__webpack_require__.nc) { - linkTag.nonce = __webpack_require__.nc; - } - var onLinkComplete = function (event) { - // avoid mem leaks. - linkTag.onerror = linkTag.onload = null; - if (event.type === 'load') { - resolve(); - } else { - var errorType = event && (event.type === 'load' ? 'missing' : event.type); - var realHref = event && event.target && event.target.href || fullhref; - var err = new Error("Loading CSS chunk " + chunkId + " failed.\\n(" + realHref + ")"); - err.code = "CSS_CHUNK_LOAD_FAILED"; - err.type = errorType; - err.request = realHref; - if (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag) - reject(err); - } - } - - linkTag.onerror = linkTag.onload = onLinkComplete; - linkTag.href = fullhref; - - if (oldTag) { - oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling); - } else { - document.head.appendChild(linkTag); - } - return linkTag; + installedChunks[chunkId][0](); } - var findStylesheet = function (href, fullhref) { - var existingLinkTags = document.getElementsByTagName("link"); - for (var i = 0; i < existingLinkTags.length; i++) { - var tag = existingLinkTags[i]; - var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); - if (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag; - } - - var existingStyleTags = document.getElementsByTagName("style"); - for (var i = 0; i < existingStyleTags.length; i++) { - var tag = existingStyleTags[i]; - var dataHref = tag.getAttribute("data-href"); - if (dataHref === href || dataHref === fullhref) return tag; - } - } - - var loadStylesheet = function (chunkId) { - return new Promise(function (resolve, reject) { - var href = __webpack_require__.miniCssF(chunkId); - var fullhref = __webpack_require__.p + href; - if (findStylesheet(href, fullhref)) return resolve(); - createStylesheet(chunkId, fullhref, null, resolve, reject); - }) - } - - // object to store loaded CSS chunks - var installedCssChunks = { - "main": 0, - - }; - - __webpack_require__.f.miniCss = function (chunkId, promises) { - var cssChunks = { - "async": 1, - - }; - if (installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]) - else if (installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) - promises.push( - installedCssChunks[chunkId] = loadStylesheet(chunkId).then( - function () { - installedCssChunks[chunkId] = 0; - }, - function (e) { - delete installedCssChunks[chunkId]; - throw e; - } - ) - ) - } - - // no hmr - - })(); - // webpack/runtime/jsonp_chunk_loading - (() => { - - // object to store loaded and loading chunks - // undefined = chunk not loaded, null = chunk preloaded/prefetched - // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded - var installedChunks = { "main": 0, }; - - __webpack_require__.f.j = function (chunkId, promises) { - // JSONP chunk loading for javascript - var installedChunkData = __webpack_require__.o(installedChunks, chunkId) - ? installedChunks[chunkId] - : undefined; - if (installedChunkData !== 0) { - // 0 means "already installed". - - // a Promise means "currently loading". - if (installedChunkData) { - promises.push(installedChunkData[2]); - } else { - if (true) { - // setup Promise in chunk cache - var promise = new Promise(function (resolve, reject) { - installedChunkData = installedChunks[chunkId] = [resolve, reject]; - }); - promises.push((installedChunkData[2] = promise)); - - // start chunk loading - var url = __webpack_require__.p + __webpack_require__.u(chunkId); - // create error before stack unwound to get useful stacktrace later - var error = new Error(); - var loadingEnded = function (event) { - if (__webpack_require__.o(installedChunks, chunkId)) { - installedChunkData = installedChunks[chunkId]; - if (installedChunkData !== 0) installedChunks[chunkId] = undefined; - if (installedChunkData) { - var errorType = - event && (event.type === 'load' ? 'missing' : event.type); - var realSrc = event && event.target && event.target.src; - error.message = - 'Loading chunk ' + - chunkId + - ' failed.\n(' + - errorType + - ': ' + - realSrc + - ')'; - error.name = 'ChunkLoadError'; - error.type = errorType; - error.request = realSrc; - installedChunkData[1](error); - } - } - }; - __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); - } - } - } - - } - // install a JSONP callback for chunk loading - var webpackJsonpCallback = function (parentChunkLoadingFunction, data) { - var chunkIds = data[0]; - var moreModules = data[1]; - var runtime = data[2]; - // add "moreModules" to the modules object, - // then flag all "chunkIds" as loaded and fire callback - var moduleId, - chunkId, - i = 0; - if (chunkIds.some(function (id) { return installedChunks[id] !== 0 })) { - for (moduleId in moreModules) { - if (__webpack_require__.o(moreModules, moduleId)) { - __webpack_require__.m[moduleId] = moreModules[moduleId]; - } - } - if (runtime) var result = runtime(__webpack_require__); - } - if (parentChunkLoadingFunction) parentChunkLoadingFunction(data); - for (; i < chunkIds.length; i++) { - chunkId = chunkIds[i]; - if ( - __webpack_require__.o(installedChunks, chunkId) && - installedChunks[chunkId] - ) { - installedChunks[chunkId][0](); - } - installedChunks[chunkId] = 0; - } - - }; - - var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; - chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); - chunkLoadingGlobal.push = webpackJsonpCallback.bind( - null, - chunkLoadingGlobal.push.bind(chunkLoadingGlobal) - ); - - })(); - /************************************************************************/ - var __webpack_exports__ = {}; - // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. - (() => { - __webpack_require__.r(__webpack_exports__); + installedChunks[chunkId] = 0; + } + +}; + +var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +chunkLoadingGlobal.push = webpackJsonpCallback.bind( + null, + chunkLoadingGlobal.push.bind(chunkLoadingGlobal) +); + +})(); +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. +(() => { +__webpack_require__.r(__webpack_exports__); /* ESM import */var _style_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./style.css"); - /* eslint-disable-next-line no-unused-expressions */ - __webpack_require__.e(/* import() | async */ "async").then(__webpack_require__.bind(__webpack_require__, "./async.css")); +/* eslint-disable-next-line no-unused-expressions */ +__webpack_require__.e(/* import() | async */ "async").then(__webpack_require__.bind(__webpack_require__, "./async.css")); - })(); +})(); })() - ; +; \ No newline at end of file diff --git a/tests/plugin-test/css-extract/cases/issue-6649/expected/main.js b/tests/plugin-test/css-extract/cases/issue-6649/expected/main.js index b66cce2456da..1c4b24287818 100644 --- a/tests/plugin-test/css-extract/cases/issue-6649/expected/main.js +++ b/tests/plugin-test/css-extract/cases/issue-6649/expected/main.js @@ -1,459 +1,433 @@ (() => { // webpackBootstrap - var __webpack_modules__ = ({}); - /************************************************************************/ - // The module cache - var __webpack_module_cache__ = {}; - - // The require function - function __webpack_require__(moduleId) { - - // Check if module is in cache - var cachedModule = __webpack_module_cache__[moduleId]; - if (cachedModule !== undefined) { - return cachedModule.exports; - } - // Create a new module (and put it into the cache) - var module = (__webpack_module_cache__[moduleId] = { - exports: {} - }); - // Execute the module function - __webpack_modules__[moduleId](module, module.exports, __webpack_require__); - - // Return the exports of the module - return module.exports; - +var __webpack_modules__ = ({}); +/************************************************************************/ +// The module cache +var __webpack_module_cache__ = {}; + +// The require function +function __webpack_require__(moduleId) { + +// Check if module is in cache +var cachedModule = __webpack_module_cache__[moduleId]; +if (cachedModule !== undefined) { +return cachedModule.exports; +} +// Create a new module (and put it into the cache) +var module = (__webpack_module_cache__[moduleId] = { +exports: {} +}); +// Execute the module function +__webpack_modules__[moduleId](module, module.exports, __webpack_require__); + +// Return the exports of the module +return module.exports; + +} + +// expose the modules object (__webpack_modules__) +__webpack_require__.m = __webpack_modules__; + +/************************************************************************/ +// webpack/runtime/create_fake_namespace_object +(() => { +var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); +var leafPrototypes; +// create a fake namespace object +// mode & 1: value is a module id, require it +// mode & 2: merge all properties of value into the ns +// mode & 4: return value when already ns object +// mode & 16: return value when it's Promise-like +// mode & 8|1: behave like require +__webpack_require__.t = function(value, mode) { + if(mode & 1) value = this(value); + if(mode & 8) return value; + if(typeof value === 'object' && value) { + if((mode & 4) && value.__esModule) return value; + if((mode & 16) && typeof value.then === 'function') return value; + } + var ns = Object.create(null); + __webpack_require__.r(ns); + var def = {}; + leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; + for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { + Object.getOwnPropertyNames(current).forEach((key) => { def[key] = () => (value[key]) }); } + def['default'] = () => (value); + __webpack_require__.d(ns, def); + return ns; +}; +})(); +// webpack/runtime/define_property_getters +(() => { +__webpack_require__.d = function(exports, definition) { + for(var key in definition) { + if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { + Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); + } + } +}; +})(); +// webpack/runtime/ensure_chunk +(() => { +__webpack_require__.f = {}; +// This file contains only the entry chunk. +// The chunk loading function for additional chunks +__webpack_require__.e = function (chunkId) { + return Promise.all( + Object.keys(__webpack_require__.f).reduce(function (promises, key) { + __webpack_require__.f[key](chunkId, promises); + return promises; + }, []) + ); +}; })(); // webpack/runtime/get javascript chunk filename (() => { - // This function allow to reference chunks - __webpack_require__.u = function (chunkId) { - // return url for filenames not based on template - - // return url for filenames based on template - return "" + chunkId + ".$" + { "\\css\\chunk": "__CONTENT__css_chunk_DH_js_HASH__", "\\js\\chunk": "__CONTENT__js_chunk_DH_js_HASH__", }[chunkId] + "$.js"; - }; - +// This function allow to reference chunks + __webpack_require__.u = function (chunkId) { + // return url for filenames not based on template + + // return url for filenames based on template + return "" + chunkId + ".$" + {"\\css\\chunk": "__CONTENT__css_chunk_DH_js_HASH__","\\js\\chunk": "__CONTENT__js_chunk_DH_js_HASH__",}[chunkId] + "$.js"; + }; + })(); // webpack/runtime/get mini-css chunk filename (() => { - // This function allow to reference chunks - __webpack_require__.miniCssF = function (chunkId) { - // return url for filenames not based on template - - // return url for filenames based on template - return "" + chunkId + ".$" + "__CONTENT__css_chunk_DH_css_HASH__" + "$.css"; - }; - +// This function allow to reference chunks + __webpack_require__.miniCssF = function (chunkId) { + // return url for filenames not based on template + + // return url for filenames based on template + return "" + chunkId + ".$" + "__CONTENT__css_chunk_DH_css_HASH__" + "$.css"; + }; + })(); // webpack/runtime/get_full_hash (() => { - __webpack_require__.h = function () { - return "__FULL_HASH__"; - }; +__webpack_require__.h = function () { + return "__FULL_HASH__"; +}; - /************************************************************************/ - // webpack/runtime/create_fake_namespace_object - (() => { - var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); - var leafPrototypes; - // create a fake namespace object - // mode & 1: value is a module id, require it - // mode & 2: merge all properties of value into the ns - // mode & 4: return value when already ns object - // mode & 16: return value when it's Promise-like - // mode & 8|1: behave like require - __webpack_require__.t = function (value, mode) { - if (mode & 1) value = this(value); - if (mode & 8) return value; - if (typeof value === 'object' && value) { - if ((mode & 4) && value.__esModule) return value; - if ((mode & 16) && typeof value.then === 'function') return value; - } - var ns = Object.create(null); - __webpack_require__.r(ns); - var def = {}; - leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; - for (var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { - Object.getOwnPropertyNames(current).forEach((key) => { def[key] = () => (value[key]) }); - } - def['default'] = () => (value); - __webpack_require__.d(ns, def); - return ns; - }; - })(); - // webpack/runtime/define_property_getters - (() => { - __webpack_require__.d = function (exports, definition) { - for (var key in definition) { - if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { - Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); - } - } - }; - })(); - // webpack/runtime/ensure_chunk - (() => { - __webpack_require__.f = {}; - // This file contains only the entry chunk. - // The chunk loading function for additional chunks - __webpack_require__.e = function (chunkId) { - return Promise.all( - Object.keys(__webpack_require__.f).reduce(function (promises, key) { - __webpack_require__.f[key](chunkId, promises); - return promises; - }, []) - ); - }; - - })(); - // webpack/runtime/get javascript chunk filename - (() => { - // This function allow to reference chunks - __webpack_require__.u = function (chunkId) { - // return url for filenames not based on template - - // return url for filenames based on template - return "" + chunkId + ".$" + { "\\css\\chunk": "b1b844425027e2012f17", "\\js\\chunk": "033244835a8df445c8ec", }[chunkId] + "$.js"; - }; - - })(); - // webpack/runtime/get mini-css chunk filename - (() => { - // This function allow to reference chunks - __webpack_require__.miniCssF = function (chunkId) { - // return url for filenames not based on template - - // return url for filenames based on template - return "" + chunkId + ".$" + "2343dba8f37350b808da" + "$.css"; - }; - - })(); - // webpack/runtime/get_full_hash - (() => { - __webpack_require__.h = function () { - return "c7531e66fd9ba2e78281"; - }; - - })(); - // webpack/runtime/global - (() => { - __webpack_require__.g = (function () { - if (typeof globalThis === 'object') return globalThis; - try { - return this || new Function('return this')(); - } catch (e) { - if (typeof window === 'object') return window; - } - })(); - - })(); - // webpack/runtime/has_own_property - (() => { - __webpack_require__.o = function (obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); - }; - - })(); - // webpack/runtime/load_script - (() => { - var inProgress = {}; - - - // loadScript function to load a script via script tag - __webpack_require__.l = function (url, done, key, chunkId) { - if (inProgress[url]) { - inProgress[url].push(done); - return; - } - var script, needAttach; - if (key !== undefined) { - var scripts = document.getElementsByTagName("script"); - for (var i = 0; i < scripts.length; i++) { - var s = scripts[i]; - if (s.getAttribute("src") == url) { - script = s; - break; - } - } - } - if (!script) { - needAttach = true; - - script = document.createElement('script'); - - script.charset = 'utf-8'; - script.timeout = 120; - if (__webpack_require__.nc) { - script.setAttribute("nonce", __webpack_require__.nc); - } +})(); +// webpack/runtime/global +(() => { +__webpack_require__.g = (function () { + if (typeof globalThis === 'object') return globalThis; + try { + return this || new Function('return this')(); + } catch (e) { + if (typeof window === 'object') return window; + } +})(); +})(); +// webpack/runtime/has_own_property +(() => { +__webpack_require__.o = function (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; - script.src = url; +})(); +// webpack/runtime/load_script +(() => { +var inProgress = {}; - } - inProgress[url] = [done]; - var onScriptComplete = function (prev, event) { - script.onerror = script.onload = null; - clearTimeout(timeout); - var doneFns = inProgress[url]; - delete inProgress[url]; - script.parentNode && script.parentNode.removeChild(script); - doneFns && - doneFns.forEach(function (fn) { - return fn(event); - }); - if (prev) return prev(event); - }; - var timeout = setTimeout( - onScriptComplete.bind(null, undefined, { - type: 'timeout', - target: script - }), - 120000 - ); - script.onerror = onScriptComplete.bind(null, script.onerror); - script.onload = onScriptComplete.bind(null, script.onload); - needAttach && document.head.appendChild(script); - }; - - })(); - // webpack/runtime/make_namespace_object - (() => { - // define __esModule on exports - __webpack_require__.r = function (exports) { - if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { - Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - } - Object.defineProperty(exports, '__esModule', { value: true }); - }; - - })(); - // webpack/runtime/auto_public_path - (() => { - var scriptUrl; - - if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; - var document = __webpack_require__.g.document; - if (!scriptUrl && document) { - // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, - // but an attacker could try to inject `` - // and use `` - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; - if (!scriptUrl) { - var scripts = document.getElementsByTagName("script"); - if (scripts.length) { - var i = scripts.length - 1; - while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; - } +// loadScript function to load a script via script tag +__webpack_require__.l = function (url, done, key, chunkId) { + if (inProgress[url]) { + inProgress[url].push(done); + return; + } + var script, needAttach; + if (key !== undefined) { + var scripts = document.getElementsByTagName("script"); + for (var i = 0; i < scripts.length; i++) { + var s = scripts[i]; + if (s.getAttribute("src") == url) { + script = s; + break; } } - - // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", - // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', - if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); - scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); - __webpack_require__.p = scriptUrl - })(); - // webpack/runtime/css loading - (() => { - if (typeof document === "undefined") return; - var createStylesheet = function ( - chunkId, fullhref, oldTag, resolve, reject - ) { - var linkTag = document.createElement("link"); - - linkTag.rel = "stylesheet"; - linkTag.type = "text/css"; - if (__webpack_require__.nc) { - linkTag.nonce = __webpack_require__.nc; - } - var onLinkComplete = function (event) { - // avoid mem leaks. - linkTag.onerror = linkTag.onload = null; - if (event.type === 'load') { - resolve(); - } else { - var errorType = event && (event.type === 'load' ? 'missing' : event.type); - var realHref = event && event.target && event.target.href || fullhref; - var err = new Error("Loading CSS chunk " + chunkId + " failed.\\n(" + realHref + ")"); - err.code = "CSS_CHUNK_LOAD_FAILED"; - err.type = errorType; - err.request = realHref; - if (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag) - reject(err); - } - } - - linkTag.onerror = linkTag.onload = onLinkComplete; - linkTag.href = fullhref; - - if (oldTag) { - oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling); - } else { - document.head.appendChild(linkTag); - } - return linkTag; + } + if (!script) { + needAttach = true; + + script = document.createElement('script'); + + script.charset = 'utf-8'; + script.timeout = 120; + if (__webpack_require__.nc) { + script.setAttribute("nonce", __webpack_require__.nc); } - var findStylesheet = function (href, fullhref) { - var existingLinkTags = document.getElementsByTagName("link"); - for (var i = 0; i < existingLinkTags.length; i++) { - var tag = existingLinkTags[i]; - var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); - if (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag; - } + + + script.src = url; + + + } + inProgress[url] = [done]; + var onScriptComplete = function (prev, event) { + script.onerror = script.onload = null; + clearTimeout(timeout); + var doneFns = inProgress[url]; + delete inProgress[url]; + script.parentNode && script.parentNode.removeChild(script); + doneFns && + doneFns.forEach(function (fn) { + return fn(event); + }); + if (prev) return prev(event); + }; + var timeout = setTimeout( + onScriptComplete.bind(null, undefined, { + type: 'timeout', + target: script + }), + 120000 + ); + script.onerror = onScriptComplete.bind(null, script.onerror); + script.onload = onScriptComplete.bind(null, script.onload); + needAttach && document.head.appendChild(script); +}; - var existingStyleTags = document.getElementsByTagName("style"); - for (var i = 0; i < existingStyleTags.length; i++) { - var tag = existingStyleTags[i]; - var dataHref = tag.getAttribute("data-href"); - if (dataHref === href || dataHref === fullhref) return tag; - } - } +})(); +// webpack/runtime/make_namespace_object +(() => { +// define __esModule on exports +__webpack_require__.r = function(exports) { + if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { + Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + } + Object.defineProperty(exports, '__esModule', { value: true }); +}; - var loadStylesheet = function (chunkId) { - return new Promise(function (resolve, reject) { - var href = __webpack_require__.miniCssF(chunkId); - var fullhref = __webpack_require__.p + href; - if (findStylesheet(href, fullhref)) return resolve(); - createStylesheet(chunkId, fullhref, null, resolve, reject); - }) +})(); +// webpack/runtime/auto_public_path +(() => { +var scriptUrl; + +if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; +var document = __webpack_require__.g.document; +if (!scriptUrl && document) { + // Technically we could use `document.currentScript instanceof window.HTMLScriptElement`, + // but an attacker could try to inject `` + // and use `` + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') scriptUrl = document.currentScript.src; + if (!scriptUrl) { + var scripts = document.getElementsByTagName("script"); + if (scripts.length) { + var i = scripts.length - 1; + while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; + } + } +} + +// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", +// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', +if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); +scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); +__webpack_require__.p = scriptUrl +})(); +// webpack/runtime/css loading +(() => { +if (typeof document === "undefined") return; +var createStylesheet = function ( + chunkId, fullhref, oldTag, resolve, reject +) { + var linkTag = document.createElement("link"); + + linkTag.rel = "stylesheet"; + linkTag.type="text/css"; + if (__webpack_require__.nc) { + linkTag.nonce = __webpack_require__.nc; + } + var onLinkComplete = function (event) { + // avoid mem leaks. + linkTag.onerror = linkTag.onload = null; + if (event.type === 'load') { + resolve(); + } else { + var errorType = event && (event.type === 'load' ? 'missing' : event.type); + var realHref = event && event.target && event.target.href || fullhref; + var err = new Error("Loading CSS chunk " + chunkId + " failed.\\n(" + realHref + ")"); + err.code = "CSS_CHUNK_LOAD_FAILED"; + err.type = errorType; + err.request = realHref; + if (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag) + reject(err); } + } - // object to store loaded CSS chunks - var installedCssChunks = { - "\\entry\\name": 0, + linkTag.onerror = linkTag.onload = onLinkComplete; + linkTag.href = fullhref; + + if (oldTag) { + oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling); +} else { + document.head.appendChild(linkTag); +} + return linkTag; +} +var findStylesheet = function (href, fullhref) { + var existingLinkTags = document.getElementsByTagName("link"); + for (var i = 0; i < existingLinkTags.length; i++) { + var tag = existingLinkTags[i]; + var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); + if (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag; + } - }; + var existingStyleTags = document.getElementsByTagName("style"); + for (var i = 0; i < existingStyleTags.length; i++) { + var tag = existingStyleTags[i]; + var dataHref = tag.getAttribute("data-href"); + if (dataHref === href || dataHref === fullhref) return tag; + } +} + +var loadStylesheet = function (chunkId) { + return new Promise(function (resolve, reject) { + var href = __webpack_require__.miniCssF(chunkId); + var fullhref = __webpack_require__.p + href; + if (findStylesheet(href, fullhref)) return resolve(); + createStylesheet(chunkId, fullhref, null, resolve, reject); + }) +} + +// object to store loaded CSS chunks +var installedCssChunks = { + "\\entry\\name": 0, + +}; + +__webpack_require__.f.miniCss = function(chunkId, promises) { + var cssChunks = { +"\\css\\chunk": 1, + +}; + if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]) + else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) + promises.push( + installedCssChunks[chunkId] = loadStylesheet(chunkId).then( + function() { + installedCssChunks[chunkId] = 0; + }, + function(e) { + delete installedCssChunks[chunkId]; + throw e; + } + ) + ) +} - __webpack_require__.f.miniCss = function (chunkId, promises) { - var cssChunks = { - "\\css\\chunk": 1, +// no hmr - }; - if (installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]) - else if (installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) - promises.push( - installedCssChunks[chunkId] = loadStylesheet(chunkId).then( - function () { - installedCssChunks[chunkId] = 0; - }, - function (e) { - delete installedCssChunks[chunkId]; - throw e; - } - ) - ) - } +})(); +// webpack/runtime/jsonp_chunk_loading +(() => { - // no hmr - - })(); - // webpack/runtime/jsonp_chunk_loading - (() => { - - // object to store loaded and loading chunks - // undefined = chunk not loaded, null = chunk preloaded/prefetched - // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded - var installedChunks = { "\\entry\\name": 0, }; - - __webpack_require__.f.j = function (chunkId, promises) { - // JSONP chunk loading for javascript - var installedChunkData = __webpack_require__.o(installedChunks, chunkId) - ? installedChunks[chunkId] - : undefined; - if (installedChunkData !== 0) { - // 0 means "already installed". - - // a Promise means "currently loading". - if (installedChunkData) { - promises.push(installedChunkData[2]); - } else { - if (true) { - // setup Promise in chunk cache - var promise = new Promise(function (resolve, reject) { - installedChunkData = installedChunks[chunkId] = [resolve, reject]; - }); - promises.push((installedChunkData[2] = promise)); - - // start chunk loading - var url = __webpack_require__.p + __webpack_require__.u(chunkId); - // create error before stack unwound to get useful stacktrace later - var error = new Error(); - var loadingEnded = function (event) { - if (__webpack_require__.o(installedChunks, chunkId)) { - installedChunkData = installedChunks[chunkId]; - if (installedChunkData !== 0) installedChunks[chunkId] = undefined; - if (installedChunkData) { - var errorType = - event && (event.type === 'load' ? 'missing' : event.type); - var realSrc = event && event.target && event.target.src; - error.message = - 'Loading chunk ' + - chunkId + - ' failed.\n(' + - errorType + - ': ' + - realSrc + - ')'; - error.name = 'ChunkLoadError'; - error.type = errorType; - error.request = realSrc; - installedChunkData[1](error); - } - } - }; - __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); + // object to store loaded and loading chunks + // undefined = chunk not loaded, null = chunk preloaded/prefetched + // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded + var installedChunks = {"\\entry\\name": 0,}; + + __webpack_require__.f.j = function (chunkId, promises) { + // JSONP chunk loading for javascript +var installedChunkData = __webpack_require__.o(installedChunks, chunkId) + ? installedChunks[chunkId] + : undefined; +if (installedChunkData !== 0) { + // 0 means "already installed". + + // a Promise means "currently loading". + if (installedChunkData) { + promises.push(installedChunkData[2]); + } else { + if (true) { + // setup Promise in chunk cache + var promise = new Promise(function (resolve, reject) { + installedChunkData = installedChunks[chunkId] = [resolve, reject]; + }); + promises.push((installedChunkData[2] = promise)); + + // start chunk loading + var url = __webpack_require__.p + __webpack_require__.u(chunkId); + // create error before stack unwound to get useful stacktrace later + var error = new Error(); + var loadingEnded = function (event) { + if (__webpack_require__.o(installedChunks, chunkId)) { + installedChunkData = installedChunks[chunkId]; + if (installedChunkData !== 0) installedChunks[chunkId] = undefined; + if (installedChunkData) { + var errorType = + event && (event.type === 'load' ? 'missing' : event.type); + var realSrc = event && event.target && event.target.src; + error.message = + 'Loading chunk ' + + chunkId + + ' failed.\n(' + + errorType + + ': ' + + realSrc + + ')'; + error.name = 'ChunkLoadError'; + error.type = errorType; + error.request = realSrc; + installedChunkData[1](error); } } + }; + __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); + } + } +} + + } + // install a JSONP callback for chunk loading +var webpackJsonpCallback = function (parentChunkLoadingFunction, data) { + var chunkIds = data[0]; + var moreModules = data[1]; + var runtime = data[2]; + // add "moreModules" to the modules object, + // then flag all "chunkIds" as loaded and fire callback + var moduleId, + chunkId, + i = 0; + if (chunkIds.some(function (id) { return installedChunks[id] !== 0 })) { + for (moduleId in moreModules) { + if (__webpack_require__.o(moreModules, moduleId)) { + __webpack_require__.m[moduleId] = moreModules[moduleId]; } - } - // install a JSONP callback for chunk loading - var webpackJsonpCallback = function (parentChunkLoadingFunction, data) { - var chunkIds = data[0]; - var moreModules = data[1]; - var runtime = data[2]; - // add "moreModules" to the modules object, - // then flag all "chunkIds" as loaded and fire callback - var moduleId, - chunkId, - i = 0; - if (chunkIds.some(function (id) { return installedChunks[id] !== 0 })) { - for (moduleId in moreModules) { - if (__webpack_require__.o(moreModules, moduleId)) { - __webpack_require__.m[moduleId] = moreModules[moduleId]; - } - } - if (runtime) var result = runtime(__webpack_require__); - } - if (parentChunkLoadingFunction) parentChunkLoadingFunction(data); - for (; i < chunkIds.length; i++) { - chunkId = chunkIds[i]; - if ( - __webpack_require__.o(installedChunks, chunkId) && - installedChunks[chunkId] - ) { - installedChunks[chunkId][0](); - } - installedChunks[chunkId] = 0; - } - - }; + if (runtime) var result = runtime(__webpack_require__); + } + if (parentChunkLoadingFunction) parentChunkLoadingFunction(data); + for (; i < chunkIds.length; i++) { + chunkId = chunkIds[i]; + if ( + __webpack_require__.o(installedChunks, chunkId) && + installedChunks[chunkId] + ) { + installedChunks[chunkId][0](); + } + installedChunks[chunkId] = 0; + } + +}; - var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; - chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); - chunkLoadingGlobal.push = webpackJsonpCallback.bind( - null, - chunkLoadingGlobal.push.bind(chunkLoadingGlobal) - ); +var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +chunkLoadingGlobal.push = webpackJsonpCallback.bind( + null, + chunkLoadingGlobal.push.bind(chunkLoadingGlobal) +); - })(); - /************************************************************************/ - var __webpack_exports__ = {}; - __webpack_require__.e(/* import() | \js\chunk */ "\\js\\chunk").then(__webpack_require__.t.bind(__webpack_require__, "./src/chunk.js", 23)); +})(); +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | \js\chunk */ "\\js\\chunk").then(__webpack_require__.t.bind(__webpack_require__, "./src/chunk.js", 23)); })() - ; +; \ No newline at end of file diff --git a/tests/webpack-test/StatsTestCases.basictest.js b/tests/webpack-test/StatsTestCases.basictest.js index bad8f028158c..3cde6d45473e 100644 --- a/tests/webpack-test/StatsTestCases.basictest.js +++ b/tests/webpack-test/StatsTestCases.basictest.js @@ -207,7 +207,11 @@ describe("StatsTestCases", () => { .replace(new RegExp(quoteMeta(testPath), "g"), "Xdir/" + testName) .replace(/(\w)\\(\w)/g, "$1/$2") .replace(/, additional resolving: X ms/g, "") - .replace(/Unexpected identifier '.+?'/g, "Unexpected identifier"); + .replace(/Unexpected identifier '.+?'/g, "Unexpected identifier") + // CHANGE: Replace bundle size, since bundle sizes may differ between platforms + .replace(/-.*\.js/g, "-xxx.js") + // CHANGE: Replace bundle size, since bundle sizes may differ between platforms + .replace(/[0-9]+\.?[0-9]+ KiB/g, "xx KiB"); expect(actual).toMatchSnapshot(); // CHANGE: check actual snapshot // if (testConfig.validate) testConfig.validate(stats, stderr.toString()); diff --git a/tests/webpack-test/__snapshots__/ConfigTestCases.basictest.js.snap b/tests/webpack-test/__snapshots__/ConfigTestCases.basictest.js.snap index 7ddfd3e775a1..ab4f8980b606 100644 --- a/tests/webpack-test/__snapshots__/ConfigTestCases.basictest.js.snap +++ b/tests/webpack-test/__snapshots__/ConfigTestCases.basictest.js.snap @@ -404,18 +404,6 @@ details { ] `; -exports[`ConfigTestCases css large exported tests should allow to create css modules: dev 1`] = ` -Object { - "placeholder": "my-app-_tailwind_module_css-placeholder-gray-700", -} -`; - -exports[`ConfigTestCases css large exported tests should allow to create css modules: prod 1`] = ` -Object { - "placeholder": "-_6d72b53b84605386-placeholder-gray-700", -} -`; - exports[`ConfigTestCases custom-modules json-custom exported tests should transform toml to json 1`] = ` Object { "owner": Object { diff --git a/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap b/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap index 2d9dada4eaaa..ee1dd3d4811f 100644 --- a/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap +++ b/tests/webpack-test/__snapshots__/StatsTestCases.basictest.js.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`StatsTestCases should print correct stats for asset 1`] = ` -"asset c560fa876f51d750.png 14.6 KiB [emitted] [immutable] [from: images/file.png] (auxiliary name: main) -asset bundle.js 13.1 KiB [emitted] (name: main) +"asset c560fa876f51d750.png xx KiB [emitted] [immutable] [from: images/file.png] (auxiliary name: main) +asset bundle.js xx KiB [emitted] (name: main) asset static/file.html 12 bytes [emitted] [from: static/file.html] (auxiliary name: main) -runtime modules 1.5 KiB 2 modules -modules by path ./ 9.34 KiB (javascript) 14.6 KiB (asset) - modules by path ./images/ 8.86 KiB (javascript) 14.6 KiB (asset) - ./images/file.png 42 bytes (javascript) 14.6 KiB (asset) [built] [code generated] +runtime modules xx KiB 2 modules +modules by path ./ xx KiB (javascript) xx KiB (asset) + modules by path ./images/ xx KiB (javascript) xx KiB (asset) + ./images/file.png 42 bytes (javascript) xx KiB (asset) [built] [code generated] ./images/file.svg 915 bytes [built] [code generated] - ./images/file.jpg 7.92 KiB [built] [code generated] + ./images/file.jpg xx KiB [built] [code generated] modules by path ./*.js 415 bytes ./index.js 402 bytes [built] [code generated] ./a.source.js 13 bytes [built] [code generated] @@ -23,14 +23,14 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for asset-concat 1`] = ` -"asset c560fa876f51d750.png 14.6 KiB [emitted] [immutable] [from: images/file.png] (auxiliary name: main) -asset bundle.js 12.3 KiB [emitted] (name: main) +"asset c560fa876f51d750.png xx KiB [emitted] [immutable] [from: images/file.png] (auxiliary name: main) +asset bundle.js xx KiB [emitted] (name: main) asset static/file.html 12 bytes [emitted] [from: static/file.html] (auxiliary name: main) -orphan modules 9.43 KiB [orphan] 8 modules -runtime modules 1.5 KiB 2 modules -cacheable modules 9.59 KiB (javascript) 14.6 KiB (asset) - ./index.js + 9 modules 9.51 KiB [code generated] - ./images/file.png 42 bytes (javascript) 14.6 KiB (asset) [built] [code generated] +orphan modules xx KiB [orphan] 8 modules +runtime modules xx KiB 2 modules +cacheable modules xx KiB (javascript) xx KiB (asset) + ./index.js + 9 modules xx KiB [code generated] + ./images/file.png 42 bytes (javascript) xx KiB (asset) [built] [code generated] ./static/file.html 42 bytes (javascript) 12 bytes (asset) [built] [code generated] Rspack x.x.x compiled successfully in X.23" `; @@ -39,7 +39,7 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk 1`] = "chunk (runtime: main) 726.js 21 bytes <{909}> [rendered] > ./index.js 9:4-13:6 ./b.js 21 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 557 bytes (javascript) 6.61 KiB (runtime) >{726}< [entry] [rendered] +chunk (runtime: main) main.js (main) 557 bytes (javascript) xx KiB (runtime) >{726}< [entry] [rendered] > ./ main dependent modules 42 bytes [dependent] 2 modules ./index.js 515 bytes [built] [code generated] @@ -48,19 +48,19 @@ Rspack x.x.x compiled successfully" exports[`StatsTestCases should print correct stats for async-commons-chunk-auto 1`] = ` "disabled: - chunk (runtime: main) disabled/async-c.js (async-c) 196 bytes [rendered] + chunk (runtime: main) disabled/async-xxx.js (async-c) 196 bytes [rendered] > ./c ./index.js 3:0-47 dependent modules 60 bytes [dependent] 3 modules ./c.js + 1 modules 136 bytes [code generated] - chunk (runtime: main) disabled/async-a.js (async-a) 245 bytes [rendered] + chunk (runtime: main) disabled/async-xxx.js (async-a) 245 bytes [rendered] > ./a ./index.js 1:0-47 dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: main) disabled/async-b.js (async-b) 196 bytes [rendered] + chunk (runtime: main) disabled/async-xxx.js (async-b) 196 bytes [rendered] > ./b ./index.js 2:0-47 dependent modules 80 bytes [dependent] 4 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: a) disabled/a.js (a) 245 bytes (javascript) 7.19 KiB (runtime) [entry] [rendered] + chunk (runtime: a) disabled/a.js (a) 245 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./a a dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] @@ -72,23 +72,23 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto > ./c c dependent modules 60 bytes [dependent] 3 modules ./c.js + 1 modules 136 bytes [code generated] - chunk (runtime: main) disabled/main.js (main) 147 bytes (javascript) 7.25 KiB (runtime) [entry] [rendered] + chunk (runtime: main) disabled/main.js (main) 147 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, main) disabled/async-g.js (async-g) 65 bytes [rendered] + chunk (runtime: a, main) disabled/async-xxx.js (async-g) 65 bytes [rendered] > ./g ./a.js 6:0-47 dependent modules 20 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] disabled (Rspack x.x.x) compiled successfully default: - chunk (runtime: main) default/async-c.js (async-c) 116 bytes [rendered] + chunk (runtime: main) default/async-xxx.js (async-c) 116 bytes [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) default/async-a.js (async-a) 185 bytes [rendered] + chunk (runtime: main) default/async-xxx.js (async-a) 185 bytes [rendered] > ./a ./index.js 1:0-47 ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: main) default/async-b.js (async-b) 116 bytes [rendered] + chunk (runtime: main) default/async-xxx.js (async-b) 116 bytes [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] chunk (runtime: main) default/310.js (id hint: vendors) 20 bytes [rendered] split chunk (cache group: defaultVendors) @@ -108,7 +108,7 @@ default: > ./c ./index.js 3:0-47 > ./g ./a.js 6:0-47 ./f.js 20 bytes [built] [code generated] - chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 7.22 KiB (runtime) [entry] [rendered] + chunk (runtime: a) default/a.js (a) 245 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./a a dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] @@ -125,20 +125,20 @@ default: > ./c c dependent modules 80 bytes [dependent] 4 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) [entry] [rendered] + chunk (runtime: main) default/main.js (main) 147 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, main) default/async-g.js (async-g) 45 bytes [rendered] + chunk (runtime: a, main) default/async-xxx.js (async-g) 45 bytes [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] default (Rspack x.x.x) compiled successfully vendors: - Entrypoint main 9.01 KiB = vendors/main.js - Entrypoint a 11.7 KiB = vendors/vendors.js 829 bytes vendors/a.js 10.9 KiB - Entrypoint b 6.32 KiB = vendors/vendors.js 829 bytes vendors/b.js 5.51 KiB - Entrypoint c 6.32 KiB = vendors/vendors.js 829 bytes vendors/c.js 5.51 KiB - chunk (runtime: main) vendors/async-c.js (async-c) 196 bytes [rendered] + Entrypoint main xx KiB = vendors/main.js + Entrypoint a xx KiB = vendors/vendors.js 829 bytes vendors/a.js xx KiB + Entrypoint b xx KiB = vendors/vendors.js 829 bytes vendors/b.js xx KiB + Entrypoint c xx KiB = vendors/vendors.js 829 bytes vendors/c.js xx KiB + chunk (runtime: main) vendors/async-xxx.js (async-c) 196 bytes [rendered] > ./c ./index.js 3:0-47 dependent modules 80 bytes [dependent] 4 modules ./c.js 116 bytes [built] [code generated] @@ -149,41 +149,41 @@ vendors: ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: main) vendors/async-a.js (async-a) 245 bytes [rendered] + chunk (runtime: main) vendors/async-xxx.js (async-a) 245 bytes [rendered] > ./a ./index.js 1:0-47 dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: main) vendors/async-b.js (async-b) 196 bytes [rendered] + chunk (runtime: main) vendors/async-xxx.js (async-b) 196 bytes [rendered] > ./b ./index.js 2:0-47 dependent modules 80 bytes [dependent] 4 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: a) vendors/a.js (a) 205 bytes (javascript) 8.27 KiB (runtime) [entry] [rendered] + chunk (runtime: a) vendors/a.js (a) 205 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./a a dependent modules 20 bytes [dependent] 1 module ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: b) vendors/b.js (b) 156 bytes (javascript) 2.86 KiB (runtime) [entry] [rendered] + chunk (runtime: b) vendors/b.js (b) 156 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./b b dependent modules 40 bytes [dependent] 2 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: c) vendors/c.js (c) 156 bytes (javascript) 2.86 KiB (runtime) [entry] [rendered] + chunk (runtime: c) vendors/c.js (c) 156 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./c c dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) vendors/main.js (main) 147 bytes (javascript) 7.25 KiB (runtime) [entry] [rendered] + chunk (runtime: main) vendors/main.js (main) 147 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, main) vendors/async-g.js (async-g) 65 bytes [rendered] + chunk (runtime: a, main) vendors/async-xxx.js (async-g) 65 bytes [rendered] > ./g ./a.js 6:0-47 dependent modules 20 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] vendors (Rspack x.x.x) compiled successfully multiple-vendors: - Entrypoint main 9.37 KiB = multiple-vendors/libs.js 4.38 KiB multiple-vendors/main.js 4.99 KiB - Entrypoint a 9.37 KiB = multiple-vendors/libs.js 4.38 KiB multiple-vendors/a.js 4.99 KiB - Entrypoint b 9.37 KiB = multiple-vendors/libs.js 4.38 KiB multiple-vendors/b.js 4.99 KiB - Entrypoint c 9.37 KiB = multiple-vendors/libs.js 4.38 KiB multiple-vendors/c.js 4.99 KiB - chunk (runtime: a, b, c, main) multiple-vendors/libs.js (libs) (id hint: libs) 709 bytes [initial] [rendered] split chunk (cache group: libs) + Entrypoint main xx KiB = multiple-xxx.js xx KiB + Entrypoint a xx KiB = multiple-xxx.js xx KiB + Entrypoint b xx KiB = multiple-xxx.js xx KiB + Entrypoint c xx KiB = multiple-xxx.js xx KiB + chunk (runtime: a, b, c, main) multiple-xxx.js (libs) (id hint: libs) 709 bytes [initial] [rendered] split chunk (cache group: libs) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -194,21 +194,21 @@ multiple-vendors: > ./ main dependent modules 562 bytes [dependent] 8 modules ./index.js 147 bytes [built] [code generated] - chunk (runtime: a) multiple-vendors/a.js (a) 3.38 KiB [entry] [rendered] + chunk (runtime: a) multiple-xxx.js (a) xx KiB [entry] [rendered] > ./a a - chunk (runtime: b) multiple-vendors/b.js (b) 3.38 KiB [entry] [rendered] + chunk (runtime: b) multiple-xxx.js (b) xx KiB [entry] [rendered] > ./b b - chunk (runtime: c) multiple-vendors/c.js (c) 3.38 KiB [entry] [rendered] + chunk (runtime: c) multiple-xxx.js (c) xx KiB [entry] [rendered] > ./c c - chunk (runtime: main) multiple-vendors/main.js (main) 3.38 KiB [entry] [rendered] + chunk (runtime: main) multiple-xxx.js (main) xx KiB [entry] [rendered] > ./ main multiple-vendors (Rspack x.x.x) compiled successfully all: - Entrypoint main 10.8 KiB = all/605.js 820 bytes all/main.js 10 KiB - Entrypoint a 12.2 KiB = all/457.js 582 bytes all/310.js 335 bytes all/697.js 335 bytes all/272.js 957 bytes all/a.js 10.1 KiB - Entrypoint b 6.35 KiB = all/457.js 582 bytes all/581.js 335 bytes all/310.js 335 bytes all/726.js 800 bytes all/b.js 4.35 KiB - Entrypoint c 6.35 KiB = all/457.js 582 bytes all/581.js 335 bytes all/416.js 335 bytes all/29.js 799 bytes all/c.js 4.35 KiB + Entrypoint main xx KiB = all/605.js 820 bytes all/main.js xx KiB + Entrypoint a xx KiB = all/457.js 582 bytes all/310.js 335 bytes all/697.js 335 bytes all/272.js 957 bytes all/a.js xx KiB + Entrypoint b xx KiB = all/457.js 582 bytes all/581.js 335 bytes all/310.js 335 bytes all/726.js 800 bytes all/b.js xx KiB + Entrypoint c xx KiB = all/457.js 582 bytes all/581.js 335 bytes all/416.js 335 bytes all/29.js 799 bytes all/c.js xx KiB chunk (runtime: main) all/199.js (id hint: vendors) 116 bytes [rendered] split chunk (cache group: vendors) > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] @@ -257,16 +257,16 @@ all: chunk (runtime: b) all/726.js (id hint: vendors) 116 bytes [initial] [rendered] split chunk (cache group: vendors) > ./b b ./b.js 116 bytes [built] [code generated] - chunk (runtime: a) all/a.js (a) 8.26 KiB [entry] [rendered] + chunk (runtime: a) all/a.js (a) xx KiB [entry] [rendered] > ./a a - chunk (runtime: b) all/b.js (b) 2.86 KiB [entry] [rendered] + chunk (runtime: b) all/b.js (b) xx KiB [entry] [rendered] > ./b b - chunk (runtime: c) all/c.js (c) 2.86 KiB [entry] [rendered] + chunk (runtime: c) all/c.js (c) xx KiB [entry] [rendered] > ./c c chunk (runtime: a, main) all/889.js (id hint: vendors) 45 bytes [rendered] split chunk (cache group: vendors) > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) all/main.js (main) 8.26 KiB [entry] [rendered] + chunk (runtime: main) all/main.js (main) xx KiB [entry] [rendered] > ./ main chunk (runtime: main) all/910.js (id hint: vendors) 165 bytes [rendered] split chunk (cache group: vendors) > ./a ./index.js 1:0-47 @@ -289,12 +289,12 @@ Rspack x.x.x compiled successfully in X.23" exports[`StatsTestCases should print correct stats for circular-correctness 1`] = ` "chunk (runtime: main) 74.bundle.js (a) 49 bytes <{76}> <{909}> >{76}< [rendered] - ./module-a.js 49 bytes [built] [code generated] + ./module-xxx.js 49 bytes [built] [code generated] chunk (runtime: main) 751.bundle.js (b) 49 bytes <{76}> <{909}> >{76}< [rendered] - ./module-b.js 49 bytes [built] [code generated] + ./module-xxx.js 49 bytes [built] [code generated] chunk (runtime: main) 76.bundle.js (c) 98 bytes <{74}> <{751}> >{74}< >{751}< [rendered] - ./module-c.js 98 bytes [built] [code generated] -chunk (runtime: main) bundle.js (main) 98 bytes (javascript) 8.29 KiB (runtime) >{74}< >{751}< [entry] [rendered] + ./module-xxx.js 98 bytes [built] [code generated] +chunk (runtime: main) bundle.js (main) 98 bytes (javascript) xx KiB (runtime) >{74}< >{751}< [entry] [rendered] ./index.js 98 bytes [built] [code generated] Rspack x.x.x compiled successfully" `; @@ -312,18 +312,18 @@ Rspack x.x.x compiled successfully in X s" `; exports[`StatsTestCases should print correct stats for common-libs 1`] = ` -"asset react.js 2.15 KiB [emitted] (name: react) +"asset react.js xx KiB [emitted] (name: react) ./react.js 74 bytes [built] [code generated] ../../../../node_modules/.pnpm/react@19.0.0/node_modules/react/index.js 186 bytes [built] [code generated] -../../../../node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react.production.js 16.5 KiB [built] [code generated] +../../../../node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react.production.js xx KiB [built] [code generated] Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for commons-chunk-min-size-Infinity 1`] = ` -"asset entry-1.js 4.38 KiB [emitted] (name: entry-1) -asset vendor-1.js 236 bytes [emitted] (name: vendor-1) (id hint: vendor-1) -Entrypoint entry-1 4.61 KiB = vendor-1.js 236 bytes entry-1.js 4.38 KiB -runtime modules 2.58 KiB 3 modules +"asset entry-xxx.js xx KiB [emitted] (name: entry-1) +asset vendor-xxx.js 236 bytes [emitted] (name: vendor-1) (id hint: vendor-1) +Entrypoint entry-xxx.js xx KiB +runtime modules xx KiB 3 modules modules by path ./modules/*.js 132 bytes ./modules/a.js 22 bytes [built] [code generated] ./modules/b.js 22 bytes [built] [code generated] @@ -331,19 +331,19 @@ modules by path ./modules/*.js 132 bytes ./modules/d.js 22 bytes [built] [code generated] ./modules/e.js 22 bytes [built] [code generated] ./modules/f.js 22 bytes [built] [code generated] -./entry-1.js 145 bytes [built] [code generated] +./entry-xxx.js 145 bytes [built] [code generated] Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for commons-plugin-issue-4980 1`] = ` -"asset app.824f7ad4e050d52c-1.js 52 bytes [emitted] [immutable] (name: app) +"asset app.824f7ad4e050d52c-xxx.js 52 bytes [emitted] [immutable] (name: app) orphan modules 205 bytes [orphan] 3 modules -./entry-1.js 67 bytes [built] [code generated] +./entry-xxx.js 67 bytes [built] [code generated] Rspack x.x.x compiled successfully in X.23 -asset app.05ce3dc57a31149c-2.js 52 bytes [emitted] [immutable] (name: app) +asset app.05ce3dc57a31149c-xxx.js 52 bytes [emitted] [immutable] (name: app) orphan modules 212 bytes [orphan] 3 modules -./entry-2.js 67 bytes [built] [code generated] +./entry-xxx.js 67 bytes [built] [code generated] Rspack x.x.x compiled successfully in X.23" `; @@ -382,8 +382,8 @@ Rspack x.x.x compiled successfully in X.23" exports[`StatsTestCases should print correct stats for exclude-with-loader 1`] = ` "hidden assets 34 bytes 1 asset -asset bundle.js 4.49 KiB [emitted] (name: main) -runtime modules 2.17 KiB 5 modules +asset bundle.js xx KiB [emitted] (name: main) +runtime modules xx KiB 5 modules hidden modules 99 bytes 2 modules cacheable modules 119 bytes ./index.js 77 bytes [built] [code generated] @@ -399,55 +399,55 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for graph-correctness-entries 1`] = ` -"chunk (runtime: e1) e1.js (e1) 49 bytes (javascript) 8.32 KiB (runtime) >{74}< [entry] [rendered] +"chunk (runtime: e1) e1.js (e1) 49 bytes (javascript) xx KiB (runtime) >{74}< [entry] [rendered] ./e1.js 49 bytes [built] [code generated] entry ./e1 chunk (runtime: e1, e2) a.js (a) 49 bytes <{605}> <{76}> >{751}< [rendered] - ./module-a.js 49 bytes [built] [code generated] - import() ./module-a ./e1.js - import() ./module-a ./module-c.js + ./module-xxx.js 49 bytes [built] [code generated] + import() ./module-xxx.js + import() ./module-xxx.js chunk (runtime: e1, e2) b.js (b) 49 bytes <{74}> >{76}< [rendered] - ./module-b.js 49 bytes [built] [code generated] - import() ./module-b ./module-a.js + ./module-xxx.js 49 bytes [built] [code generated] + import() ./module-xxx.js chunk (runtime: e1, e2) c.js (c) 49 bytes <{751}> <{844}> >{74}< [rendered] - ./module-c.js 49 bytes [built] [code generated] - import() ./module-c ./e2.js - import() ./module-c ./module-b.js -chunk (runtime: e2) e2.js (e2) 49 bytes (javascript) 8.32 KiB (runtime) >{76}< [entry] [rendered] + ./module-xxx.js 49 bytes [built] [code generated] + import() ./module-xxx.js + import() ./module-xxx.js +chunk (runtime: e2) e2.js (e2) 49 bytes (javascript) xx KiB (runtime) >{76}< [entry] [rendered] ./e2.js 49 bytes [built] [code generated] entry ./e2 Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for graph-correctness-modules 1`] = ` -"chunk (runtime: e1) e1.js (e1) 119 bytes (javascript) 8.63 KiB (runtime) >{74}< >{984}< [entry] [rendered] +"chunk (runtime: e1) e1.js (e1) 119 bytes (javascript) xx KiB (runtime) >{74}< >{984}< [entry] [rendered] ./e1.js 70 bytes [built] [code generated] entry ./e1 - ./module-x.js 49 bytes [dependent] [built] [code generated] - esm import ./module-x ./e1.js 1:0-20 - esm import ./module-x ./e2.js 1:0-20 - import() ./module-x ./module-b.js + ./module-xxx.js 49 bytes [dependent] [built] [code generated] + esm import ./module-xxx.js 1:0-20 + esm import ./module-xxx.js 1:0-20 + import() ./module-xxx.js chunk (runtime: e1, e2) a.js (a) 49 bytes <{605}> <{76}> >{751}< [rendered] - ./module-a.js 49 bytes [built] [code generated] - import() ./module-a ./e1.js - import() ./module-a ./module-c.js + ./module-xxx.js 49 bytes [built] [code generated] + import() ./module-xxx.js + import() ./module-xxx.js chunk (runtime: e1, e2) b.js (b) 179 bytes <{74}> >{76}< [rendered] - ./module-b.js 179 bytes [built] [code generated] - import() ./module-b ./module-a.js + ./module-xxx.js 179 bytes [built] [code generated] + import() ./module-xxx.js chunk (runtime: e1, e2) c.js (c) 49 bytes <{751}> <{844}> >{74}< [rendered] - ./module-c.js 49 bytes [built] [code generated] - import() ./module-c ./e2.js - import() ./module-c ./module-b.js -chunk (runtime: e2) e2.js (e2) 119 bytes (javascript) 8.63 KiB (runtime) >{76}< >{984}< [entry] [rendered] + ./module-xxx.js 49 bytes [built] [code generated] + import() ./module-xxx.js + import() ./module-xxx.js +chunk (runtime: e2) e2.js (e2) 119 bytes (javascript) xx KiB (runtime) >{76}< >{984}< [entry] [rendered] ./e2.js 70 bytes [built] [code generated] entry ./e2 - ./module-x.js 49 bytes [dependent] [built] [code generated] - esm import ./module-x ./e1.js 1:0-20 - esm import ./module-x ./e2.js 1:0-20 - import() ./module-x ./module-b.js + ./module-xxx.js 49 bytes [dependent] [built] [code generated] + esm import ./module-xxx.js 1:0-20 + esm import ./module-xxx.js 1:0-20 + import() ./module-xxx.js chunk (runtime: e1, e2) y.js (y) 1 bytes <{605}> <{844}> [rendered] - ./module-y.js 1 bytes [built] [code generated] - import() ./module-y ./module-x.js + ./module-xxx.js 1 bytes [built] [code generated] + import() ./module-xxx.js Rspack x.x.x compiled successfully" `; @@ -469,15 +469,15 @@ chunk (runtime: main) cycles.js (cycles) 410 bytes [rendered] ./cycles/2/a.js 39 bytes [built] [code generated] ./cycles/2/b.js 76 bytes [built] [code generated] ./cycles/2/index.js 39 bytes [built] [code generated] -chunk (runtime: main) id-equals-name_js.js (id-equals-name_js) 21 bytes [rendered] - ./id-equals-name.js?1 21 bytes [built] [code generated] -chunk (runtime: main) id-equals-name_js-_70e2.js (id-equals-name_js-_70e2) 21 bytes [rendered] - ./id-equals-name.js?2 21 bytes [built] [code generated] -chunk (runtime: main) id-equals-name_js0.js 21 bytes [rendered] - ./id-equals-name.js 21 bytes [built] [code generated] -chunk (runtime: main) id-equals-name_js_3.js 21 bytes [rendered] - ./id-equals-name.js?3 21 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 639 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] +chunk (runtime: main) id-xxx.js (id-equals-name_js) 21 bytes [rendered] + ./id-xxx.js?1 21 bytes [built] [code generated] +chunk (runtime: main) id-xxx.js (id-equals-name_js-_70e2) 21 bytes [rendered] + ./id-xxx.js?2 21 bytes [built] [code generated] +chunk (runtime: main) id-xxx.js 21 bytes [rendered] + ./id-xxx.js 21 bytes [built] [code generated] +chunk (runtime: main) id-xxx.js 21 bytes [rendered] + ./id-xxx.js?3 21 bytes [built] [code generated] +chunk (runtime: main) main.js (main) 639 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./index.js 639 bytes [built] [code generated] chunk (runtime: main) tree.js (tree) 137 bytes [rendered] dependent modules 98 bytes [dependent] 3 modules @@ -497,31 +497,31 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for immutable 1`] = ` -"asset 725eb9ab1d49e958.js 10.4 KiB [emitted] [immutable] (name: main) +"asset 936a5667d4bb7d33.js xx KiB [emitted] [immutable] (name: main) asset 7342054f673663df.js 167 bytes [emitted] [immutable]" `; exports[`StatsTestCases should print correct stats for import-context-filter 1`] = ` -"asset entry.js 9.99 KiB [emitted] (name: entry) +"asset entry.js xx KiB [emitted] (name: entry) asset 228.js 405 bytes [emitted] asset 271.js 405 bytes [emitted] asset 536.js 405 bytes [emitted] -runtime modules 7.17 KiB 9 modules +runtime modules xx KiB 9 modules cacheable modules 724 bytes modules by path ./templates/*.js 114 bytes ./templates/bar.js 38 bytes [built] [code generated] ./templates/baz.js 38 bytes [built] [code generated] ./templates/foo.js 38 bytes [built] [code generated] ./entry.js 450 bytes [built] [code generated] - Xdir/import-context-filter/templates|lazy|/^\\\\.\\\\/.*$/|include: /\\\\.js$/|exclude: /\\\\.noimport\\\\.js$/|groupOptions: {}|namespace object 160 bytes [built] [code generated] + Xdir/import-xxx.js$/|groupOptions: {}|namespace object 160 bytes [built] [code generated] Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for import-weak 1`] = ` -"asset entry.js 10.1 KiB [emitted] (name: entry) +"asset entry.js xx KiB [emitted] (name: entry) asset 332.js 283 bytes [emitted] asset 313.js 128 bytes [emitted] -runtime modules 8.28 KiB 10 modules +runtime modules xx KiB 10 modules cacheable modules 179 bytes ./entry.js 120 bytes [built] [code generated] ./modules/a.js 37 bytes [built] [code generated] @@ -530,10 +530,10 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for import-weak-parser-option 1`] = ` -"asset entry.js 10.1 KiB [emitted] (name: entry) +"asset entry.js xx KiB [emitted] (name: entry) asset 332.js 283 bytes [emitted] asset 313.js 128 bytes [emitted] -runtime modules 8.28 KiB 10 modules +runtime modules xx KiB 10 modules cacheable modules 153 bytes ./entry.js 94 bytes [built] [code generated] ./modules/a.js 37 bytes [built] [code generated] @@ -542,14 +542,14 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for import-with-invalid-options-comments 1`] = ` -"runtime modules 9.33 KiB 12 modules +"runtime modules xx KiB 12 modules cacheable modules 559 bytes ./index.js 50 bytes [built] [code generated] ./chunk.js 401 bytes [built] [code generated] [2 warnings] - ./chunk-a.js 27 bytes [built] [code generated] - ./chunk-b.js 27 bytes [built] [code generated] - ./chunk-c.js 27 bytes [built] [code generated] - ./chunk-d.js 27 bytes [built] [code generated] + ./chunk-xxx.js 27 bytes [built] [code generated] + ./chunk-xxx.js 27 bytes [built] [code generated] + ./chunk-xxx.js 27 bytes [built] [code generated] + ./chunk-xxx.js 27 bytes [built] [code generated] WARNING in ./chunk.js ⚠ Module parse warning: @@ -581,33 +581,33 @@ Rspack x.x.x compiled with 2 warnings" `; exports[`StatsTestCases should print correct stats for issue-7577 1`] = ` -"asset a-runtime~main-d595864193436fca.js 3.69 KiB [emitted] [immutable] (name: runtime~main) -asset a-main-f9892dc0f961d982.js 387 bytes [emitted] [immutable] (name: main) -asset a-all-a_js-cace9eea394248e7.js 128 bytes [emitted] [immutable] (id hint: all) -Entrypoint main 4.19 KiB = a-runtime~main-d595864193436fca.js 3.69 KiB a-all-a_js-cace9eea394248e7.js 128 bytes a-main-f9892dc0f961d982.js 387 bytes -runtime modules 2.59 KiB 3 modules +"asset a-xxx.js xx KiB [emitted] [immutable] (name: runtime~main) +asset a-xxx.js 387 bytes [emitted] [immutable] (name: main) +asset a-xxx.js 128 bytes [emitted] [immutable] (id hint: all) +Entrypoint main xx KiB = a-xxx.js 387 bytes +runtime modules xx KiB 3 modules ./a.js 18 bytes [built] [code generated] Rspack x.x.x compiled successfully in X.23 -asset b-runtime~main-1f9fbe5f46bddaf3.js 4.38 KiB [emitted] [immutable] (name: runtime~main) -asset b-all-b_js-f689e3be6ed05e06.js 453 bytes [emitted] [immutable] (id hint: all) -asset b-main-a97968a81f0fafdb.js 420 bytes [emitted] [immutable] (name: main) -asset b-vendors-node_modules_vendor_js-8e4df31a4698ceb4.js 173 bytes [emitted] [immutable] (id hint: vendors) -Entrypoint main 5.41 KiB = b-runtime~main-1f9fbe5f46bddaf3.js 4.38 KiB b-vendors-node_modules_vendor_js-8e4df31a4698ceb4.js 173 bytes b-all-b_js-f689e3be6ed05e06.js 453 bytes b-main-a97968a81f0fafdb.js 420 bytes -runtime modules 3.17 KiB 5 modules +asset b-xxx.js xx KiB [emitted] [immutable] (name: runtime~main) +asset b-xxx.js 453 bytes [emitted] [immutable] (id hint: all) +asset b-xxx.js 420 bytes [emitted] [immutable] (name: main) +asset b-xxx.js 173 bytes [emitted] [immutable] (id hint: vendors) +Entrypoint main xx KiB = b-xxx.js 420 bytes +runtime modules xx KiB 5 modules cacheable modules 40 bytes ./b.js 17 bytes [built] [code generated] ./node_modules/vendor.js 23 bytes [built] [code generated] Rspack x.x.x compiled successfully in X.23 assets by chunk 862 bytes (id hint: all) - asset c-all-b_js-b683c5304b71900e.js 480 bytes [emitted] [immutable] (id hint: all) - asset c-all-c_js-2c876c6ecab93d9b.js 382 bytes [emitted] [immutable] (id hint: all) -asset c-runtime~main-ff03a71e8e030f89.js 11.1 KiB [emitted] [immutable] (name: runtime~main) -asset c-main-1b0ba12f79ed8053.js 643 bytes [emitted] [immutable] (name: main) -asset c-vendors-node_modules_vendor_js-8e4df31a4698ceb4.js 173 bytes [emitted] [immutable] (id hint: vendors) -Entrypoint main 12.1 KiB = c-runtime~main-ff03a71e8e030f89.js 11.1 KiB c-all-c_js-2c876c6ecab93d9b.js 382 bytes c-main-1b0ba12f79ed8053.js 643 bytes -runtime modules 9.73 KiB 13 modules + asset c-xxx.js 480 bytes [emitted] [immutable] (id hint: all) + asset c-xxx.js 382 bytes [emitted] [immutable] (id hint: all) +asset c-xxx.js xx KiB [emitted] [immutable] (name: runtime~main) +asset c-xxx.js 588 bytes [emitted] [immutable] (name: main) +asset c-xxx.js 173 bytes [emitted] [immutable] (id hint: vendors) +Entrypoint main xx KiB = c-xxx.js 588 bytes +runtime modules xx KiB 13 modules cacheable modules 101 bytes ./c.js 61 bytes [built] [code generated] ./b.js 17 bytes [built] [code generated] @@ -617,8 +617,8 @@ Rspack x.x.x compiled successfully in X.23" exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1`] = ` "1 chunks: - asset bundle1.js 3.79 KiB [emitted] (name: main) - chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.78 KiB (runtime) <{909}> >{909}< [entry] [rendered] + asset bundle1.js xx KiB [emitted] (name: main) + chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) xx KiB (runtime) <{909}> >{909}< [entry] [rendered] ./a.js 22 bytes [dependent] [built] [code generated] ./b.js 22 bytes [dependent] [built] [code generated] ./c.js 30 bytes [dependent] [built] [code generated] @@ -628,7 +628,7 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1 chunks (Rspack x.x.x) compiled successfully in X.23 2 chunks: - asset bundle2.js 10.1 KiB [emitted] (name: main) + asset bundle2.js xx KiB [emitted] (name: main) asset 76.bundle2.js 599 bytes [emitted] (name: c) chunk (runtime: main) 76.bundle2.js (c) 118 bytes <{76}> <{909}> >{76}< [rendered] dependent modules 44 bytes [dependent] @@ -637,12 +637,12 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin ./a.js 22 bytes [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle2.js (main) 101 bytes (javascript) 8.29 KiB (runtime) >{76}< [entry] [rendered] + chunk (runtime: main) bundle2.js (main) 101 bytes (javascript) xx KiB (runtime) >{76}< [entry] [rendered] ./index.js 101 bytes [built] [code generated] 2 chunks (Rspack x.x.x) compiled successfully in X.23 3 chunks: - asset bundle3.js 10.1 KiB [emitted] (name: main) + asset bundle3.js xx KiB [emitted] (name: main) asset 76.bundle3.js 385 bytes [emitted] (name: c) asset 656.bundle3.js 290 bytes [emitted] chunk (runtime: main) 656.bundle3.js 88 bytes <{76}> <{909}> [rendered] @@ -652,12 +652,12 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin ./e.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle3.js (c) 30 bytes <{909}> >{656}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle3.js (main) 101 bytes (javascript) 8.29 KiB (runtime) >{656}< >{76}< [entry] [rendered] + chunk (runtime: main) bundle3.js (main) 101 bytes (javascript) xx KiB (runtime) >{656}< >{76}< [entry] [rendered] ./index.js 101 bytes [built] [code generated] 3 chunks (Rspack x.x.x) compiled successfully in X.23 4 chunks: - asset bundle4.js 10.1 KiB [emitted] (name: main) + asset bundle4.js xx KiB [emitted] (name: main) asset 76.bundle4.js 385 bytes [emitted] (name: c) asset 537.bundle4.js 236 bytes [emitted] asset 697.bundle4.js 128 bytes [emitted] @@ -669,7 +669,7 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin ./e.js 22 bytes [built] [code generated] chunk (runtime: main) 76.bundle4.js (c) 30 bytes <{909}> >{537}< >{697}< [rendered] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) bundle4.js (main) 101 bytes (javascript) 8.29 KiB (runtime) >{537}< >{76}< [entry] [rendered] + chunk (runtime: main) bundle4.js (main) 101 bytes (javascript) xx KiB (runtime) >{537}< >{76}< [entry] [rendered] ./index.js 101 bytes [built] [code generated] 4 chunks (Rspack x.x.x) compiled successfully in X.23" `; @@ -682,7 +682,7 @@ Rspack x.x.x compiled successfully in X s" `; exports[`StatsTestCases should print correct stats for max-modules 1`] = ` -"asset main.js 4.69 KiB [emitted] (name: main) +"asset main.js xx KiB [emitted] (name: main) ./index.js 181 bytes [built] [code generated] ./a.js?1 33 bytes [built] [code generated] ./a.js?2 33 bytes [built] [code generated] @@ -707,7 +707,7 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for max-modules-default 1`] = ` -"asset main.js 4.69 KiB [emitted] (name: main) +"asset main.js xx KiB [emitted] (name: main) ./index.js 181 bytes [built] [code generated] ./a.js?1 33 bytes [built] [code generated] ./a.js?2 33 bytes [built] [code generated] @@ -727,23 +727,23 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for module-assets 1`] = ` -"assets by path *.js 8.92 KiB - asset main.js 8.48 KiB [emitted] (name: main) +"assets by path *.js xx KiB + asset main.js xx KiB [emitted] (name: main) asset b.js 224 bytes [emitted] (name: b) asset a.js 223 bytes [emitted] (name: a) -assets by path *.png 42 KiB - asset 1.png 21 KiB [emitted] [from: node_modules/a/1.png] - asset 2.png 21 KiB [emitted] [from: node_modules/a/2.png] -Entrypoint main 8.48 KiB = main.js +assets by path *.png xx KiB + asset 1.png xx KiB [emitted] [from: node_modules/a/1.png] + asset 2.png xx KiB [emitted] [from: node_modules/a/2.png] +Entrypoint main xx KiB = main.js Chunk Group a 223 bytes = a.js Chunk Group b 224 bytes = b.js chunk (runtime: main) a.js (a) 36 bytes [rendered] ./node_modules/a/index.js 36 bytes [built] [code generated] chunk (runtime: main) b.js (b) 18 bytes [rendered] ./node_modules/b/index.js 18 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 82 bytes (javascript) 6.91 KiB (runtime) [entry] [rendered] +chunk (runtime: main) main.js (main) 82 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./index.js 82 bytes [built] [code generated] -runtime modules 6.91 KiB 8 modules +runtime modules xx KiB 8 modules orphan modules 98 bytes [orphan] 2 modules modules with assets 136 bytes ./index.js 82 bytes [built] [code generated] @@ -753,9 +753,9 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for module-deduplication 1`] = ` -"asset e1.js 9.87 KiB [emitted] (name: e1) -asset e2.js 9.87 KiB [emitted] (name: e2) -asset e3.js 9.87 KiB [emitted] (name: e3) +"asset e1.js xx KiB [emitted] (name: e1) +asset e2.js xx KiB [emitted] (name: e2) +asset e3.js xx KiB [emitted] (name: e3) asset 106.js 749 bytes [emitted] asset 511.js 749 bytes [emitted] asset 637.js 749 bytes [emitted] @@ -772,20 +772,20 @@ chunk (runtime: e3) 400.js 61 bytes [rendered] chunk (runtime: e1, e3) 511.js 81 bytes [rendered] ./async2.js 61 bytes [built] [code generated] ./f.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e1) e1.js (e1) 249 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 249 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] ./e1.js + 2 modules 209 bytes [code generated] chunk (runtime: e2, e3) 637.js 81 bytes [rendered] ./async1.js 61 bytes [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e3) e3.js (e3) 249 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] +chunk (runtime: e3) e3.js (e3) 249 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./e3.js + 2 modules 209 bytes [code generated] ./h.js 20 bytes [dependent] [built] [code generated] chunk (runtime: e2) 806.js 61 bytes [rendered] ./async2.js 61 bytes [built] [code generated] -chunk (runtime: e2) e2.js (e2) 249 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 249 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./e2.js + 2 modules 209 bytes [code generated] ./f.js 20 bytes [dependent] [built] [code generated] @@ -793,16 +793,16 @@ Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for module-deduplication-named 1`] = ` -"asset e1.js 9.73 KiB [emitted] (name: e1) -asset e2.js 9.73 KiB [emitted] (name: e2) -asset e3.js 9.73 KiB [emitted] (name: e3) +"asset e1.js xx KiB [emitted] (name: e1) +asset e2.js xx KiB [emitted] (name: e2) +asset e3.js xx KiB [emitted] (name: e3) asset async1.js 861 bytes [emitted] (name: async1) asset async2.js 860 bytes [emitted] (name: async2) asset async3.js 860 bytes [emitted] (name: async3) chunk (runtime: e1, e2, e3) async3.js (async3) 135 bytes [rendered] ./async3.js 115 bytes [built] [code generated] ./h.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e1) e1.js (e1) 242 bytes (javascript) 7.22 KiB (runtime) [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 242 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] ./e1.js + 2 modules 202 bytes [code generated] @@ -812,11 +812,11 @@ chunk (runtime: e1, e2, e3) async2.js (async2) 135 bytes [rendered] chunk (runtime: e1, e2, e3) async1.js (async1) 135 bytes [rendered] ./async1.js 115 bytes [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e3) e3.js (e3) 242 bytes (javascript) 7.22 KiB (runtime) [entry] [rendered] +chunk (runtime: e3) e3.js (e3) 242 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./e3.js + 2 modules 202 bytes [code generated] ./h.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e2) e2.js (e2) 242 bytes (javascript) 7.22 KiB (runtime) [entry] [rendered] +chunk (runtime: e2) e2.js (e2) 242 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 20 bytes [dependent] [built] [code generated] ./e2.js + 2 modules 202 bytes [code generated] ./f.js 20 bytes [dependent] [built] [code generated] @@ -844,7 +844,7 @@ Rspack compiled with 2 errors" `; exports[`StatsTestCases should print correct stats for module-reasons 1`] = ` -"asset main.js 1.09 KiB [emitted] (name: main) +"asset main.js xx KiB [emitted] (name: main) orphan modules 102 bytes [orphan] 3 modules cacheable modules 110 bytes ./index.js + 2 modules 102 bytes [code generated] @@ -856,21 +856,21 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for module-trace-disabled-in-error 1`] = ` -"assets by status 1.7 KiB [cached] 1 asset +"assets by status xx KiB [cached] 1 asset modules with errors 53 bytes [errors] - ./not-existing.js 26 bytes [built] [code generated] [1 error] - ./parse-error.js 27 bytes [built] [code generated] [1 error] + ./not-xxx.js 26 bytes [built] [code generated] [1 error] + ./parse-xxx.js 27 bytes [built] [code generated] [1 error] ./index.js 19 bytes [built] [code generated] ./inner.js 53 bytes [built] [code generated] -ERROR in ./not-existing.js 1:8-25 +ERROR in ./not-xxx.js 1:8-25 × Module not found: Can't resolve 'does-not-exist' in 'Xdir/module-trace-disabled-in-error' ╭──── 1 │ require('does-not-exist') · ───────────────────────── ╰──── -ERROR in ./parse-error.js +ERROR in ./parse-xxx.js × Module parse failed: ╰─▶ × JavaScript parsing error: Expression expected ╭─[3:4] @@ -889,14 +889,14 @@ Rspack x.x.x compiled with 2 errors in X.23" `; exports[`StatsTestCases should print correct stats for module-trace-enabled-in-error 1`] = ` -"assets by status 1.7 KiB [cached] 1 asset +"assets by status xx KiB [cached] 1 asset modules with errors 53 bytes [errors] - ./not-existing.js 26 bytes [built] [code generated] [1 error] - ./parse-error.js 27 bytes [built] [code generated] [1 error] + ./not-xxx.js 26 bytes [built] [code generated] [1 error] + ./parse-xxx.js 27 bytes [built] [code generated] [1 error] ./index.js 19 bytes [built] [code generated] ./inner.js 53 bytes [built] [code generated] -ERROR in ./not-existing.js 1:8-25 +ERROR in ./not-xxx.js 1:8-25 × Module not found: Can't resolve 'does-not-exist' in 'Xdir/module-trace-enabled-in-error' ╭──── 1 │ require('does-not-exist') @@ -905,7 +905,7 @@ ERROR in ./not-existing.js 1:8-25 @ ./inner.js @ ./index.js -ERROR in ./parse-error.js +ERROR in ./parse-xxx.js × Module parse failed: ╰─▶ × JavaScript parsing error: Expression expected ╭─[3:4] @@ -926,64 +926,64 @@ Rspack x.x.x compiled with 2 errors in X.23" `; exports[`StatsTestCases should print correct stats for named-chunk-groups 1`] = ` -"Chunk Group async-a 997 bytes = a-727.js 248 bytes a-async-a.js 749 bytes -Chunk Group async-b 997 bytes = a-727.js 248 bytes a-async-b.js 749 bytes -Chunk Group async-c 1.21 KiB = a-vendors.js 582 bytes a-async-c.js 652 bytes -Chunk Group main 9.5 KiB = a-main.js -chunk (runtime: main) a-async-c.js (async-c) 67 bytes [rendered] +"Chunk Group async-xxx.js 749 bytes +Chunk Group async-xxx.js 749 bytes +Chunk Group async-xxx.js 652 bytes +Chunk Group main xx KiB = a-xxx.js +chunk (runtime: main) a-xxx.js (async-c) 67 bytes [rendered] > ./c ./index.js 3:0-47 ./c.js 67 bytes [built] [code generated] -chunk (runtime: main) a-vendors.js (vendors) (id hint: vendors) 40 bytes [rendered] split chunk (cache group: vendors) +chunk (runtime: main) a-xxx.js (vendors) (id hint: vendors) 40 bytes [rendered] split chunk (cache group: vendors) > ./c ./index.js 3:0-47 ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] -chunk (runtime: main) a-async-a.js (async-a) 175 bytes [rendered] +chunk (runtime: main) a-xxx.js (async-a) 175 bytes [rendered] > ./a ./index.js 1:0-47 ./a.js 175 bytes [built] [code generated] -chunk (runtime: main) a-async-b.js (async-b) 175 bytes [rendered] +chunk (runtime: main) a-xxx.js (async-b) 175 bytes [rendered] > ./b ./index.js 2:0-47 ./b.js 175 bytes [built] [code generated] -chunk (runtime: main) a-727.js (id hint: ) 149 bytes [rendered] split chunk (cache group: default) +chunk (runtime: main) a-xxx.js (id hint: ) 149 bytes [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./shared.js 149 bytes [built] [code generated] -chunk (runtime: main) a-main.js (main) 146 bytes (javascript) 7.55 KiB (runtime) [entry] [rendered] +chunk (runtime: main) a-xxx.js (main) 146 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./ main ./index.js 146 bytes [built] [code generated] Rspack x.x.x compiled successfully -Entrypoint main 9.5 KiB = b-main.js -Chunk Group async-a 997 bytes = b-727.js 248 bytes b-async-a.js 749 bytes -Chunk Group async-b 997 bytes = b-727.js 248 bytes b-async-b.js 749 bytes -Chunk Group async-c 1.21 KiB = b-vendors.js 582 bytes b-async-c.js 652 bytes -chunk (runtime: main) b-async-c.js (async-c) 67 bytes [rendered] +Entrypoint main xx KiB = b-xxx.js +Chunk Group async-xxx.js 749 bytes +Chunk Group async-xxx.js 749 bytes +Chunk Group async-xxx.js 652 bytes +chunk (runtime: main) b-xxx.js (async-c) 67 bytes [rendered] > ./c ./index.js 3:0-47 ./c.js 67 bytes [built] [code generated] -chunk (runtime: main) b-vendors.js (vendors) (id hint: vendors) 40 bytes [rendered] split chunk (cache group: vendors) +chunk (runtime: main) b-xxx.js (vendors) (id hint: vendors) 40 bytes [rendered] split chunk (cache group: vendors) > ./c ./index.js 3:0-47 ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] -chunk (runtime: main) b-async-a.js (async-a) 175 bytes [rendered] +chunk (runtime: main) b-xxx.js (async-a) 175 bytes [rendered] > ./a ./index.js 1:0-47 ./a.js 175 bytes [built] [code generated] -chunk (runtime: main) b-async-b.js (async-b) 175 bytes [rendered] +chunk (runtime: main) b-xxx.js (async-b) 175 bytes [rendered] > ./b ./index.js 2:0-47 ./b.js 175 bytes [built] [code generated] -chunk (runtime: main) b-727.js (id hint: ) 149 bytes [rendered] split chunk (cache group: default) +chunk (runtime: main) b-xxx.js (id hint: ) 149 bytes [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./shared.js 149 bytes [built] [code generated] -chunk (runtime: main) b-main.js (main) 146 bytes (javascript) 7.55 KiB (runtime) [entry] [rendered] +chunk (runtime: main) b-xxx.js (main) 146 bytes (javascript) xx KiB (runtime) [entry] [rendered] > ./ main ./index.js 146 bytes [built] [code generated] Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for named-chunks-plugin 1`] = ` -"asset entry.js 4.27 KiB [emitted] (name: entry) +"asset entry.js xx KiB [emitted] (name: entry) asset vendor.js 211 bytes [emitted] (name: vendor) (id hint: vendor) -Entrypoint entry 4.48 KiB = vendor.js 211 bytes entry.js 4.27 KiB -runtime modules 2.58 KiB 3 modules +Entrypoint entry xx KiB = vendor.js 211 bytes entry.js xx KiB +runtime modules xx KiB 3 modules cacheable modules 138 bytes ./entry.js 72 bytes [built] [code generated] ./modules/a.js 22 bytes [built] [code generated] @@ -993,7 +993,7 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = ` -"asset main.js 9.19 KiB {909} [emitted] (name: main) +"asset main.js xx KiB {909} [emitted] (name: main) asset cir2 from cir1.js 351 bytes {334} [emitted] (name: cir2 from cir1) asset cir1.js 325 bytes {228} [emitted] (name: cir1) asset cir2.js 325 bytes {787} [emitted] (name: cir2) @@ -1025,7 +1025,7 @@ chunk {405} (runtime: main) ac in ab.js (ac in ab) 2 bytes <{909}> [rendered] chunk {787} (runtime: main) cir2.js (cir2) 81 bytes <{909}> >{228}< [rendered] > [10] ./index.js 14:0-54 ./circular2.js [193] 81 bytes {334} {787} [built] [code generated] -chunk {909} (runtime: main) main.js (main) 524 bytes (javascript) 6.72 KiB (runtime) >{228}< >{295}< >{37}< >{405}< >{787}< >{919}< [entry] [rendered] +chunk {909} (runtime: main) main.js (main) 524 bytes (javascript) xx KiB (runtime) >{228}< >{295}< >{37}< >{405}< >{787}< >{919}< [entry] [rendered] > ./index main ./index.js [10] 523 bytes {909} [built] [code generated] ./modules/f.js [544] 1 bytes {909} [dependent] [built] [code generated] @@ -1040,9 +1040,9 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for output-module 1`] = ` -"asset main.mjs 7.88 KiB [emitted] [javascript module] (name: main) +"asset main.mjs xx KiB [emitted] [javascript module] (name: main) asset 8.mjs 268 bytes [emitted] [javascript module] -runtime modules 6.18 KiB 8 modules +runtime modules xx KiB 8 modules orphan modules 225 bytes [orphan] 2 modules cacheable modules 263 bytes ./index.js + 1 modules 225 bytes [code generated] @@ -1051,7 +1051,7 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for parse-error 1`] = ` -"assets by status 1.4 KiB [cached] 1 asset +"assets by status xx KiB [cached] 1 asset orphan modules 30 bytes [orphan] 2 modules cacheable modules 85 bytes ./index.js + 1 modules 30 bytes [code generated] @@ -1078,61 +1078,61 @@ Rspack x.x.x compiled with 1 error" `; exports[`StatsTestCases should print correct stats for performance-different-mode-and-target 1`] = ` -"asset warning.pro-web.js 294 KiB [emitted] [big] (name: main) -./index.js 293 KiB [built] [code generated] +"asset warning.pro-xxx.js xx KiB [emitted] [big] (name: main) +./index.js xx KiB [built] [code generated] -WARNING in ⚠ asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance.Assets: - │ warning.pro-web.js (293.956 KiB) +WARNING in ⚠ asset size limit: The following asset(s) exceed the recommended size limit (xx KiB). This can impact web performance.Assets: + │ warning.pro-xxx.js (xx KiB) -WARNING in ⚠ entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance.Entrypoints: - │ main (293.956 KiB) - │ warning.pro-web.js +WARNING in ⚠ entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (xx KiB). This can impact web performance.Entrypoints: + │ main (xx KiB) + │ warning.pro-xxx.js WARNING in ⚠ Rspack performance recommendations:You can limit the size of your bundles by using import() to lazy load some parts of your application. │ For more info visit https://www.rspack.dev/guide/optimization/code-splitting Rspack x.x.x compiled with 3 warnings in X.23 -asset warning.pro-webworker.js 294 KiB [emitted] [big] (name: main) -./index.js 293 KiB [built] [code generated] +asset warning.pro-xxx.js xx KiB [emitted] [big] (name: main) +./index.js xx KiB [built] [code generated] -WARNING in ⚠ asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance.Assets: - │ warning.pro-webworker.js (293.956 KiB) +WARNING in ⚠ asset size limit: The following asset(s) exceed the recommended size limit (xx KiB). This can impact web performance.Assets: + │ warning.pro-xxx.js (xx KiB) -WARNING in ⚠ entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance.Entrypoints: - │ main (293.956 KiB) - │ warning.pro-webworker.js +WARNING in ⚠ entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (xx KiB). This can impact web performance.Entrypoints: + │ main (xx KiB) + │ warning.pro-xxx.js WARNING in ⚠ Rspack performance recommendations:You can limit the size of your bundles by using import() to lazy load some parts of your application. │ For more info visit https://www.rspack.dev/guide/optimization/code-splitting Rspack x.x.x compiled with 3 warnings in X.23 -asset no-warning.pro-node.js 294 KiB [emitted] (name: main) -./index.js 293 KiB [built] [code generated] +asset no-xxx.js xx KiB [emitted] (name: main) +./index.js xx KiB [built] [code generated] Rspack x.x.x compiled successfully in X.23 -asset no-warning.dev-web.js 1.72 MiB [emitted] (name: main) -./index.js 293 KiB [built] [code generated] +asset no-xxx.js 1.72 MiB [emitted] (name: main) +./index.js xx KiB [built] [code generated] Rspack x.x.x compiled successfully in X.23 -asset no-warning.dev-node.js 1.72 MiB [emitted] (name: main) -./index.js 293 KiB [built] [code generated] +asset no-xxx.js 1.72 MiB [emitted] (name: main) +./index.js xx KiB [built] [code generated] Rspack x.x.x compiled successfully in X.23 -asset no-warning.dev-web-with-limit-set.js 1.72 MiB [emitted] [big] (name: main) -./index.js 293 KiB [built] [code generated] +asset no-xxx.js 1.72 MiB [emitted] [big] (name: main) +./index.js xx KiB [built] [code generated] Rspack x.x.x compiled successfully in X.23 -asset warning.pro-node-with-hints-set.js 294 KiB [emitted] [big] (name: main) -./index.js 293 KiB [built] [code generated] +asset warning.pro-xxx.js xx KiB [emitted] [big] (name: main) +./index.js xx KiB [built] [code generated] -WARNING in ⚠ asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance.Assets: - │ warning.pro-node-with-hints-set.js (293.956 KiB) +WARNING in ⚠ asset size limit: The following asset(s) exceed the recommended size limit (xx KiB). This can impact web performance.Assets: + │ warning.pro-xxx.js (xx KiB) -WARNING in ⚠ entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance.Entrypoints: - │ main (293.956 KiB) - │ warning.pro-node-with-hints-set.js +WARNING in ⚠ entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (xx KiB). This can impact web performance.Entrypoints: + │ main (xx KiB) + │ warning.pro-xxx.js WARNING in ⚠ Rspack performance recommendations:You can limit the size of your bundles by using import() to lazy load some parts of your application. │ For more info visit https://www.rspack.dev/guide/optimization/code-splitting @@ -1141,25 +1141,25 @@ Rspack x.x.x compiled with 3 warnings in X.23" `; exports[`StatsTestCases should print correct stats for performance-no-async-chunks-shown 1`] = ` -"asset main.js 294 KiB [emitted] [big] (name: main) -asset sec.js 1.13 KiB [emitted] (name: sec) -Entrypoint main [big] 294 KiB = main.js -Entrypoint sec 1.13 KiB = sec.js +"asset main.js xx KiB [emitted] [big] (name: main) +asset sec.js xx KiB [emitted] (name: sec) +Entrypoint main [big] xx KiB = main.js +Entrypoint sec xx KiB = sec.js ./index.js 32 bytes [built] [code generated] ./index2.js 48 bytes [built] [code generated] -./a.js 293 KiB [built] [code generated] +./a.js xx KiB [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 22 bytes [built] [code generated] ./d.js 22 bytes [built] [code generated] -WARNING in ⚠ asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance. +WARNING in ⚠ asset size limit: The following asset(s) exceed the recommended size limit (xx KiB). This can impact web performance. │ Assets: - │ main.js (294.014 KiB) + │ main.js (xx KiB) -WARNING in ⚠ entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance. +WARNING in ⚠ entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (xx KiB). This can impact web performance. │ Entrypoints: - │ main (294.014 KiB) + │ main (xx KiB) │ main.js @@ -1172,25 +1172,25 @@ Rspack x.x.x compiled with 3 warnings in X s" `; exports[`StatsTestCases should print correct stats for performance-oversize-limit-error 1`] = ` -"asset main.js 294 KiB [emitted] [big] (name: main) -asset sec.js 294 KiB [emitted] [big] (name: sec) -Entrypoint main [big] 294 KiB = main.js -Entrypoint sec [big] 294 KiB = sec.js +"asset main.js xx KiB [emitted] [big] (name: main) +asset sec.js xx KiB [emitted] [big] (name: sec) +Entrypoint main [big] xx KiB = main.js +Entrypoint sec [big] xx KiB = sec.js ./index.js 16 bytes [built] [code generated] ./index2.js 16 bytes [built] [code generated] -./a.js 293 KiB [built] [code generated] +./a.js xx KiB [built] [code generated] -ERROR in × asset size limit: The following asset(s) exceed the recommended size limit (244.141 KiB). This can impact web performance. +ERROR in × asset size limit: The following asset(s) exceed the recommended size limit (xx KiB). This can impact web performance. │ Assets: - │ main.js (293.936 KiB) - │ sec.js (293.936 KiB) + │ main.js (xx KiB) + │ sec.js (xx KiB) -ERROR in × entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244.141 KiB). This can impact web performance. +ERROR in × entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (xx KiB). This can impact web performance. │ Entrypoints: - │ main (293.936 KiB) + │ main (xx KiB) │ main.js - │ sec (293.936 KiB) + │ sec (xx KiB) │ sec.js @@ -1203,14 +1203,14 @@ Rspack x.x.x compiled with 3 errors in X s" `; exports[`StatsTestCases should print correct stats for prefetch 1`] = ` -"asset main.js 13.7 KiB {909} [emitted] (name: main) +"asset main.js xx KiB {909} [emitted] (name: main) asset prefetched.js 552 bytes {674} [emitted] (name: prefetched) asset inner2.js 126 bytes {857} [emitted] (name: inner2) asset inner.js 100 bytes {481} [emitted] (name: inner) asset normal.js 100 bytes {615} [emitted] (name: normal) asset prefetched2.js 100 bytes {424} [emitted] (name: prefetched2) asset prefetched3.js 100 bytes {182} [emitted] (name: prefetched3) -Entrypoint main 13.7 KiB = main.js +Entrypoint main xx KiB = main.js prefetch: prefetched.js {674} (name: prefetched), prefetched3.js {182} (name: prefetched3), prefetched2.js {424} (name: prefetched2) chunk {182} (runtime: main) prefetched3.js (prefetched3) 1 bytes <{909}> [rendered] chunk {424} (runtime: main) prefetched2.js (prefetched2) 1 bytes <{909}> [rendered] @@ -1218,7 +1218,7 @@ chunk {481} (runtime: main) inner.js (inner) 1 bytes <{674}> [rendered] chunk {615} (runtime: main) normal.js (normal) 1 bytes <{909}> [rendered] chunk {674} (runtime: main) prefetched.js (prefetched) 228 bytes <{909}> >{481}< >{857}< (prefetch: {857} {481}) [rendered] chunk {857} (runtime: main) inner2.js (inner2) 2 bytes <{674}> [rendered] -chunk {909} (runtime: main) main.js (main) 436 bytes (javascript) 10.8 KiB (runtime) >{182}< >{424}< >{615}< >{674}< (prefetch: {674} {182} {424}) [entry] [rendered]" +chunk {909} (runtime: main) main.js (main) 436 bytes (javascript) xx KiB (runtime) >{182}< >{424}< >{615}< >{674}< (prefetch: {674} {182} {424}) [entry] [rendered]" `; exports[`StatsTestCases should print correct stats for prefetch-preload-mixed 1`] = ` @@ -1232,18 +1232,18 @@ chunk (runtime: main) a2.js (a2) 1 bytes <{74}> [rendered] chunk (runtime: main) b.js (b) 203 bytes <{909}> >{438}< >{439}< >{826}< (prefetch: {826} {438}) (preload: {439}) [rendered] chunk (runtime: main) c.js (c) 134 bytes <{909}> >{380}< >{433}< (preload: {433} {380}) [rendered] chunk (runtime: main) b1.js (b1) 1 bytes <{751}> [rendered] -chunk (runtime: main) main.js (main) 195 bytes (javascript) 11.5 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered]" +chunk (runtime: main) main.js (main) 195 bytes (javascript) xx KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered]" `; exports[`StatsTestCases should print correct stats for preload 1`] = ` -"asset main.js 12.3 KiB [emitted] (name: main) +"asset main.js xx KiB [emitted] (name: main) asset preloaded.js 552 bytes [emitted] (name: preloaded) asset inner2.js 126 bytes [emitted] (name: inner2) asset inner.js 100 bytes [emitted] (name: inner) asset normal.js 100 bytes [emitted] (name: normal) asset preloaded2.js 99 bytes [emitted] (name: preloaded2) asset preloaded3.js 98 bytes [emitted] (name: preloaded3) -Entrypoint main 12.3 KiB = main.js +Entrypoint main xx KiB = main.js preload: preloaded.js {154} (name: preloaded), preloaded3.js {551} (name: preloaded3), preloaded2.js {577} (name: preloaded2) chunk (runtime: main) preloaded.js (preloaded) 226 bytes (preload: {857} {481}) [rendered] chunk (runtime: main) inner.js (inner) 1 bytes [rendered] @@ -1251,7 +1251,7 @@ chunk (runtime: main) preloaded3.js (preloaded3) 1 bytes [rendered] chunk (runtime: main) preloaded2.js (preloaded2) 1 bytes [rendered] chunk (runtime: main) normal.js (normal) 1 bytes [rendered] chunk (runtime: main) inner2.js (inner2) 2 bytes [rendered] -chunk (runtime: main) main.js (main) 424 bytes (javascript) 9.62 KiB (runtime) (preload: {154} {551} {577}) [entry] [rendered]" +chunk (runtime: main) main.js (main) 424 bytes (javascript) xx KiB (runtime) (preload: {154} {551} {577}) [entry] [rendered]" `; exports[`StatsTestCases should print correct stats for preset-errors-only 1`] = `""`; @@ -1321,86 +1321,86 @@ Rspack x.x.x compiled successfully" exports[`StatsTestCases should print correct stats for related-assets 1`] = ` "default: - assets by path *.br 13.9 KiB - asset default-main.js.br 11.9 KiB [emitted] - asset default-main.js.map.br 675 bytes [emitted] + assets by path *.br xx KiB + asset default-xxx.js.br xx KiB [emitted] + asset default-xxx.js.map.br 675 bytes [emitted] + 6 assets - assets by path *.gz 13.9 KiB - asset default-main.js.gz 11.9 KiB [emitted] - asset default-main.js.map.gz 675 bytes [emitted] - asset default-chunk_js.js.gz 611 bytes [emitted] + assets by path *.gz xx KiB + asset default-xxx.js.gz xx KiB [emitted] + asset default-xxx.js.map.gz 675 bytes [emitted] + asset default-xxx.js.gz 611 bytes [emitted] + 5 assets - assets by path *.js 12.5 KiB - asset default-main.js 11.9 KiB [emitted] (name: main) - asset default-chunk_js.js 611 bytes [emitted] + assets by path *.js xx KiB + asset default-xxx.js xx KiB [emitted] (name: main) + asset default-xxx.js 611 bytes [emitted] assets by path *.css 142 bytes asset default-chunk_js.css 73 bytes [emitted] asset default-main.css 69 bytes [emitted] (name: main) relatedAssets: - assets by path *.br 13.9 KiB - asset relatedAssets-main.js.br 11.9 KiB [emitted] - asset relatedAssets-main.js.map.br 681 bytes [emitted] + assets by path *.br xx KiB + asset relatedAssets-xxx.js.br xx KiB [emitted] + asset relatedAssets-xxx.js.map.br 681 bytes [emitted] + 6 assets - assets by path *.gz 13.9 KiB - asset relatedAssets-main.js.gz 11.9 KiB [emitted] - asset relatedAssets-main.js.map.gz 681 bytes [emitted] - asset relatedAssets-chunk_js.js.gz 617 bytes [emitted] + assets by path *.gz xx KiB + asset relatedAssets-xxx.js.gz xx KiB [emitted] + asset relatedAssets-xxx.js.map.gz 681 bytes [emitted] + asset relatedAssets-xxx.js.gz 617 bytes [emitted] + 5 assets - assets by path *.js 12.5 KiB - asset relatedAssets-main.js 11.9 KiB [emitted] (name: main) - asset relatedAssets-chunk_js.js 617 bytes [emitted] + assets by path *.js xx KiB + asset relatedAssets-xxx.js xx KiB [emitted] (name: main) + asset relatedAssets-xxx.js 617 bytes [emitted] assets by path *.css 154 bytes asset relatedAssets-chunk_js.css 79 bytes [emitted] asset relatedAssets-main.css 75 bytes [emitted] (name: main) exclude1: - hidden assets 27.8 KiB 16 assets - assets by status 12.6 KiB [emitted] - assets by path *.js 12.5 KiB - asset exclude1-main.js 11.9 KiB [emitted] (name: main) - asset exclude1-chunk_js.js 612 bytes [emitted] + hidden assets xx KiB 16 assets + assets by status xx KiB [emitted] + assets by path *.js xx KiB + asset exclude1-xxx.js xx KiB [emitted] (name: main) + asset exclude1-xxx.js 612 bytes [emitted] assets by path *.css 144 bytes asset exclude1-chunk_js.css 74 bytes [emitted] asset exclude1-main.css 70 bytes [emitted] (name: main) exclude2: - assets by path *.br 13.9 KiB - asset exclude2-main.js.br 11.9 KiB [emitted] - asset exclude2-main.js.map.br 676 bytes [emitted] + assets by path *.br xx KiB + asset exclude2-xxx.js.br xx KiB [emitted] + asset exclude2-xxx.js.map.br 676 bytes [emitted] + 6 assets - assets by path *.gz 13.9 KiB - asset exclude2-main.js.gz 11.9 KiB [emitted] - asset exclude2-main.js.map.gz 676 bytes [emitted] - asset exclude2-chunk_js.js.gz 612 bytes [emitted] + assets by path *.gz xx KiB + asset exclude2-xxx.js.gz xx KiB [emitted] + asset exclude2-xxx.js.map.gz 676 bytes [emitted] + asset exclude2-xxx.js.gz 612 bytes [emitted] + 5 assets - assets by path *.js 12.5 KiB - asset exclude2-main.js 11.9 KiB [emitted] (name: main) - asset exclude2-chunk_js.js 612 bytes [emitted] + assets by path *.js xx KiB + asset exclude2-xxx.js xx KiB [emitted] (name: main) + asset exclude2-xxx.js 612 bytes [emitted] assets by path *.css 144 bytes asset exclude2-chunk_js.css 74 bytes [emitted] asset exclude2-main.css 70 bytes [emitted] (name: main) exclude3: - hidden assets 2.89 KiB 10 assets - assets by status 37.5 KiB [emitted] - assets by path *.br 12.8 KiB - asset exclude3-main.js.br 11.9 KiB [emitted] - asset exclude3-main.js.map.br 676 bytes [emitted] + hidden assets xx KiB 10 assets + assets by status xx KiB [emitted] + assets by path *.br xx KiB + asset exclude3-xxx.js.br xx KiB [emitted] + asset exclude3-xxx.js.map.br 676 bytes [emitted] asset exclude3-main.css.map.br 171 bytes [emitted] asset exclude3-main.css.br 70 bytes [emitted] - assets by path *.gz 12.8 KiB - asset exclude3-main.js.gz 11.9 KiB [emitted] - asset exclude3-main.js.map.gz 676 bytes [emitted] + assets by path *.gz xx KiB + asset exclude3-xxx.js.gz xx KiB [emitted] + asset exclude3-xxx.js.map.gz 676 bytes [emitted] asset exclude3-main.css.map.gz 171 bytes [emitted] asset exclude3-main.css.gz 70 bytes [emitted] - assets by chunk 12 KiB (name: main) - asset exclude3-main.js 11.9 KiB [emitted] (name: main) + assets by chunk xx KiB (name: main) + asset exclude3-xxx.js xx KiB [emitted] (name: main) asset exclude3-main.css 70 bytes [emitted] (name: main)" `; exports[`StatsTestCases should print correct stats for reverse-sort-modules 1`] = ` -"asset main.js 4.69 KiB [emitted] (name: main) +"asset main.js xx KiB [emitted] (name: main) ./index.js 181 bytes [built] [code generated] ./c.js?9 33 bytes [built] [code generated] ./c.js?8 33 bytes [built] [code generated] @@ -1436,37 +1436,37 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for runtime-chunk 1`] = ` -"Entrypoint e1 4.07 KiB = runtime~e1.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.07 KiB = runtime~e2.js 3.68 KiB e2.js 391 bytes +"Entrypoint e1 xx KiB = runtime~e1.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = runtime~e2.js xx KiB e2.js 391 bytes Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for runtime-chunk-issue-7382 1`] = ` -"Entrypoint e1 4.36 KiB = runtime.js 3.68 KiB all.js 310 bytes e1.js 381 bytes -Entrypoint e2 4.36 KiB = runtime.js 3.68 KiB all.js 310 bytes e2.js 381 bytes +"Entrypoint e1 xx KiB = runtime.js xx KiB all.js 310 bytes e1.js 381 bytes +Entrypoint e2 xx KiB = runtime.js xx KiB all.js 310 bytes e2.js 381 bytes Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for runtime-chunk-single 1`] = ` -"Entrypoint e1 4.06 KiB = runtime.js 3.68 KiB e1.js 391 bytes -Entrypoint e2 4.06 KiB = runtime.js 3.68 KiB e2.js 391 bytes +"Entrypoint e1 xx KiB = runtime.js xx KiB e1.js 391 bytes +Entrypoint e2 xx KiB = runtime.js xx KiB e2.js 391 bytes Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for runtime-specific-used-exports 1`] = ` "production: - asset production-a.js 10.5 KiB [emitted] (name: a) - asset production-b.js 10.5 KiB [emitted] (name: b) - asset production-dx_js.js 843 bytes [emitted] - asset production-dw_js-_b3b00.js 834 bytes [emitted] - asset production-dw_js-_b3b01.js 834 bytes [emitted] - asset production-dy_js.js 827 bytes [emitted] - asset production-dz_js.js 827 bytes [emitted] - asset production-c.js 45 bytes [emitted] (name: c) - chunk (runtime: a) production-a.js (a) 605 bytes (javascript) 7.18 KiB (runtime) [entry] [rendered] + asset production-xxx.js xx KiB [emitted] (name: a) + asset production-xxx.js xx KiB [emitted] (name: b) + asset production-xxx.js 843 bytes [emitted] + asset production-xxx.js 834 bytes [emitted] + asset production-xxx.js 834 bytes [emitted] + asset production-xxx.js 827 bytes [emitted] + asset production-xxx.js 827 bytes [emitted] + asset production-xxx.js 45 bytes [emitted] (name: c) + chunk (runtime: a) production-xxx.js (a) 605 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./a.js 261 bytes [built] [code generated] [no exports used] - ./dx-importer.js 63 bytes [dependent] [built] [code generated] + ./dx-xxx.js 63 bytes [dependent] [built] [code generated] [only some exports used: default] ./module.js 122 bytes [dependent] [built] [code generated] [only some exports used: x, y] @@ -1474,10 +1474,10 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp [only some exports used: x, y] ./reexport.js 37 bytes [dependent] [built] [code generated] [only some exports used: x, y] - chunk (runtime: b) production-b.js (b) 605 bytes (javascript) 7.18 KiB (runtime) [entry] [rendered] + chunk (runtime: b) production-xxx.js (b) 605 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 261 bytes [built] [code generated] [no exports used] - ./dx-importer.js 63 bytes [dependent] [built] [code generated] + ./dx-xxx.js 63 bytes [dependent] [built] [code generated] [only some exports used: default] ./module.js 122 bytes [dependent] [built] [code generated] [only some exports used: x, y] @@ -1485,31 +1485,31 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp [only some exports used: x, y] ./reexport.js 37 bytes [dependent] [built] [code generated] [only some exports used: x, y] - chunk (runtime: c) production-c.js (c) 9 bytes [entry] [rendered] + chunk (runtime: c) production-xxx.js (c) 9 bytes [entry] [rendered] ./c.js 9 bytes [built] [code generated] [no exports used] - chunk (runtime: a) production-dw_js-_b3b00.js 168 bytes [rendered] + chunk (runtime: a) production-xxx.js 168 bytes [rendered] ./dw.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - chunk (runtime: b) production-dw_js-_b3b01.js 168 bytes [rendered] + chunk (runtime: b) production-xxx.js 168 bytes [rendered] ./dw.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - chunk (runtime: a, b) production-dx_js.js 168 bytes [rendered] + chunk (runtime: a, b) production-xxx.js 168 bytes [rendered] ./dx.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - chunk (runtime: a) production-dy_js.js 168 bytes [rendered] + chunk (runtime: a) production-xxx.js 168 bytes [rendered] ./dy.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - chunk (runtime: b) production-dz_js.js 168 bytes [rendered] + chunk (runtime: b) production-xxx.js 168 bytes [rendered] ./dz.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - runtime modules 14.4 KiB 18 modules - cacheable modules 1.15 KiB + runtime modules xx KiB 18 modules + cacheable modules xx KiB ./a.js 261 bytes [built] [code generated] [no exports used] ./b.js 261 bytes [built] [code generated] @@ -1520,7 +1520,7 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp [only some exports used: x, y] ./reexport.js 37 bytes [built] [code generated] [only some exports used: x, y] - ./dx-importer.js 63 bytes [built] [code generated] + ./dx-xxx.js 63 bytes [built] [code generated] [only some exports used: default] ./dy.js 46 bytes [built] [code generated] ./dw.js 46 bytes [built] [code generated] @@ -1533,17 +1533,17 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp production (Rspack x.x.x) compiled successfully in X.23 development: - asset development-a.js 12 KiB [emitted] (name: a) - asset development-b.js 12 KiB [emitted] (name: b) - asset development-dw_js.js 1.07 KiB [emitted] - asset development-dx_js.js 1.07 KiB [emitted] - asset development-dy_js.js 1.07 KiB [emitted] - asset development-dz_js.js 1.07 KiB [emitted] - asset development-c.js 419 bytes [emitted] (name: c) - chunk (runtime: a) development-a.js (a) 605 bytes (javascript) 7.18 KiB (runtime) [entry] [rendered] + asset development-xxx.js xx KiB [emitted] (name: a) + asset development-xxx.js xx KiB [emitted] (name: b) + asset development-xxx.js xx KiB [emitted] + asset development-xxx.js xx KiB [emitted] + asset development-xxx.js xx KiB [emitted] + asset development-xxx.js xx KiB [emitted] + asset development-xxx.js 419 bytes [emitted] (name: c) + chunk (runtime: a) development-xxx.js (a) 605 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./a.js 261 bytes [built] [code generated] [used exports unknown] - ./dx-importer.js 63 bytes [dependent] [built] [code generated] + ./dx-xxx.js 63 bytes [dependent] [built] [code generated] [used exports unknown] ./module.js 122 bytes [dependent] [built] [code generated] [used exports unknown] @@ -1551,10 +1551,10 @@ development: [used exports unknown] ./reexport.js 37 bytes [dependent] [built] [code generated] [used exports unknown] - chunk (runtime: b) development-b.js (b) 605 bytes (javascript) 7.18 KiB (runtime) [entry] [rendered] + chunk (runtime: b) development-xxx.js (b) 605 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 261 bytes [built] [code generated] [used exports unknown] - ./dx-importer.js 63 bytes [dependent] [built] [code generated] + ./dx-xxx.js 63 bytes [dependent] [built] [code generated] [used exports unknown] ./module.js 122 bytes [dependent] [built] [code generated] [used exports unknown] @@ -1562,31 +1562,31 @@ development: [used exports unknown] ./reexport.js 37 bytes [dependent] [built] [code generated] [used exports unknown] - chunk (runtime: c) development-c.js (c) 9 bytes [entry] [rendered] + chunk (runtime: c) development-xxx.js (c) 9 bytes [entry] [rendered] ./c.js 9 bytes [built] [code generated] [used exports unknown] - chunk (runtime: a, b) development-dw_js.js 168 bytes [rendered] + chunk (runtime: a, b) development-xxx.js 168 bytes [rendered] ./dw.js 46 bytes [built] [code generated] [used exports unknown] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [used exports unknown] - chunk (runtime: a, b) development-dx_js.js 168 bytes [rendered] + chunk (runtime: a, b) development-xxx.js 168 bytes [rendered] ./dx.js 46 bytes [built] [code generated] [used exports unknown] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [used exports unknown] - chunk (runtime: a) development-dy_js.js 168 bytes [rendered] + chunk (runtime: a) development-xxx.js 168 bytes [rendered] ./dy.js 46 bytes [built] [code generated] [used exports unknown] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [used exports unknown] - chunk (runtime: b) development-dz_js.js 168 bytes [rendered] + chunk (runtime: b) development-xxx.js 168 bytes [rendered] ./dz.js 46 bytes [built] [code generated] [used exports unknown] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [used exports unknown] - runtime modules 14.4 KiB 18 modules - cacheable modules 1.15 KiB + runtime modules xx KiB 18 modules + cacheable modules xx KiB ./a.js 261 bytes [built] [code generated] [used exports unknown] ./b.js 261 bytes [built] [code generated] @@ -1597,7 +1597,7 @@ development: [used exports unknown] ./reexport.js 37 bytes [built] [code generated] [used exports unknown] - ./dx-importer.js 63 bytes [built] [code generated] + ./dx-xxx.js 63 bytes [built] [code generated] [used exports unknown] ./dy.js 46 bytes [built] [code generated] [used exports unknown] @@ -1614,17 +1614,17 @@ development: development (Rspack x.x.x) compiled successfully in X.23 global: - asset global-a.js 10.6 KiB [emitted] (name: a) - asset global-b.js 10.6 KiB [emitted] (name: b) - asset global-dw_js.js 843 bytes [emitted] - asset global-dx_js.js 843 bytes [emitted] - asset global-dy_js.js 843 bytes [emitted] - asset global-dz_js.js 843 bytes [emitted] - asset global-c.js 45 bytes [emitted] (name: c) - chunk (runtime: a) global-a.js (a) 605 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] + asset global-xxx.js xx KiB [emitted] (name: a) + asset global-xxx.js xx KiB [emitted] (name: b) + asset global-xxx.js 843 bytes [emitted] + asset global-xxx.js 843 bytes [emitted] + asset global-xxx.js 843 bytes [emitted] + asset global-xxx.js 843 bytes [emitted] + asset global-xxx.js 45 bytes [emitted] (name: c) + chunk (runtime: a) global-xxx.js (a) 605 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./a.js 261 bytes [built] [code generated] [no exports used] - ./dx-importer.js 63 bytes [dependent] [built] [code generated] + ./dx-xxx.js 63 bytes [dependent] [built] [code generated] [only some exports used: default] ./module.js 122 bytes [dependent] [built] [code generated] [only some exports used: x, y] @@ -1632,10 +1632,10 @@ global: [only some exports used: x, y] ./reexport.js 37 bytes [dependent] [built] [code generated] [only some exports used: x, y] - chunk (runtime: b) global-b.js (b) 605 bytes (javascript) 7.17 KiB (runtime) [entry] [rendered] + chunk (runtime: b) global-xxx.js (b) 605 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 261 bytes [built] [code generated] [no exports used] - ./dx-importer.js 63 bytes [dependent] [built] [code generated] + ./dx-xxx.js 63 bytes [dependent] [built] [code generated] [only some exports used: default] ./module.js 122 bytes [dependent] [built] [code generated] [only some exports used: x, y] @@ -1643,27 +1643,27 @@ global: [only some exports used: x, y] ./reexport.js 37 bytes [dependent] [built] [code generated] [only some exports used: x, y] - chunk (runtime: c) global-c.js (c) 9 bytes [entry] [rendered] + chunk (runtime: c) global-xxx.js (c) 9 bytes [entry] [rendered] ./c.js 9 bytes [built] [code generated] [no exports used] - chunk (runtime: a, b) global-dw_js.js 168 bytes [rendered] + chunk (runtime: a, b) global-xxx.js 168 bytes [rendered] ./dw.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - chunk (runtime: a, b) global-dx_js.js 168 bytes [rendered] + chunk (runtime: a, b) global-xxx.js 168 bytes [rendered] ./dx.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - chunk (runtime: a) global-dy_js.js 168 bytes [rendered] + chunk (runtime: a) global-xxx.js 168 bytes [rendered] ./dy.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - chunk (runtime: b) global-dz_js.js 168 bytes [rendered] + chunk (runtime: b) global-xxx.js 168 bytes [rendered] ./dz.js 46 bytes [built] [code generated] ./module.js?chunk 122 bytes [dependent] [built] [code generated] [only some exports used: identity, w, x, y, z] - runtime modules 14.3 KiB 18 modules - cacheable modules 1.15 KiB + runtime modules xx KiB 18 modules + cacheable modules xx KiB ./a.js 261 bytes [built] [code generated] [no exports used] ./b.js 261 bytes [built] [code generated] @@ -1674,7 +1674,7 @@ global: [only some exports used: x, y] ./reexport.js 37 bytes [built] [code generated] [only some exports used: x, y] - ./dx-importer.js 63 bytes [built] [code generated] + ./dx-xxx.js 63 bytes [built] [code generated] [only some exports used: default] ./dy.js 46 bytes [built] [code generated] ./dw.js 46 bytes [built] [code generated] @@ -1688,7 +1688,7 @@ global: `; exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = ` -"runtime modules 14.4 KiB 18 modules +"runtime modules xx KiB 18 modules orphan modules 118 bytes [orphan] 4 modules cacheable modules 726 bytes ./first.js 236 bytes [built] [code generated] @@ -1700,8 +1700,8 @@ cacheable modules 726 bytes ./common_lazy_shared.js 25 bytes [built] [code generated] Rspack x.x.x compiled successfully in X.23 -runtime modules 14.4 KiB 18 modules -cacheable modules 1.05 KiB +runtime modules xx KiB 18 modules +cacheable modules xx KiB built modules 844 bytes [built] orphan modules 325 bytes [orphan] ./lazy_first.js 91 bytes [orphan] [built] @@ -1717,7 +1717,7 @@ cacheable modules 1.05 KiB Statement with side_effects in source code at ./second.js:4:0-62 ModuleConcatenation bailout: Module is an entry point ./lazy_shared.js 56 bytes [built] [code generated] - ModuleConcatenation bailout: Cannot concat with Xdir/scope-hoisting-multi/common_lazy_shared.js: Module ./common_lazy_shared.js is referenced from different chunks by these modules: ./lazy_first.js, ./lazy_second.js + ModuleConcatenation bailout: Cannot concat with Xdir/scope-xxx.js ./common_lazy_shared.js 25 bytes [built] [code generated] ./lazy_first.js + 1 modules 116 bytes [code generated] ./lazy_second.js + 1 modules 116 bytes [code generated] @@ -1725,9 +1725,9 @@ Rspack x.x.x compiled successfully in X.23" `; exports[`StatsTestCases should print correct stats for side-effects-issue-7428 1`] = ` -"asset main.js 9.96 KiB [emitted] (name: main) +"asset main.js xx KiB [emitted] (name: main) asset 0.js 561 bytes [emitted] -runtime modules 7.17 KiB 9 modules +runtime modules xx KiB 9 modules cacheable modules 967 bytes modules by path ./components/src/ 501 bytes orphan modules 315 bytes [orphan] @@ -1814,17 +1814,17 @@ Rspack x.x.x compiled successfully in X.23" exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` "default: - Entrypoint main 9.39 KiB = default/main.js - Entrypoint a 10.1 KiB = default/a.js - Entrypoint b 3.06 KiB = default/b.js - Entrypoint c 3.06 KiB = default/c.js - chunk (runtime: main) default/async-c.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] + Entrypoint main xx KiB = default/main.js + Entrypoint a xx KiB = default/a.js + Entrypoint b xx KiB = default/b.js + Entrypoint c xx KiB = default/c.js + chunk (runtime: main) default/async-xxx.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) default/async-a.js (async-a) 185 bytes <{909}> ={310}= ={418}= ={753}= >{581}< >{912}< [rendered] + chunk (runtime: main) default/async-xxx.js (async-a) 185 bytes <{909}> ={310}= ={418}= ={753}= >{581}< >{912}< [rendered] > ./a ./index.js 1:0-47 ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: main) default/async-b.js (async-b) 116 bytes <{909}> ={310}= ={418}= ={581}= ={753}= [rendered] + chunk (runtime: main) default/async-xxx.js (async-b) 116 bytes <{909}> ={310}= ={418}= ={581}= ={753}= [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] chunk (runtime: main) default/310.js (id hint: vendors) 20 bytes <{909}> ={250}= ={262}= ={418}= ={581}= ={753}= >{581}< >{912}< [rendered] split chunk (cache group: defaultVendors) @@ -1844,7 +1844,7 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` > ./c ./index.js 3:0-47 > ./g ./a.js 6:0-47 ./f.js 20 bytes [built] [code generated] - chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 7.22 KiB (runtime) >{581}< >{912}< [entry] [rendered] + chunk (runtime: a) default/a.js (a) 245 bytes (javascript) xx KiB (runtime) >{581}< >{912}< [entry] [rendered] > ./a a dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] @@ -1861,39 +1861,39 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` > ./c c dependent modules 80 bytes [dependent] 4 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{753}< [entry] [rendered] + chunk (runtime: main) default/main.js (main) 147 bytes (javascript) xx KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{753}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, main) default/async-g.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{74}> <{753}> ={581}= [rendered] + chunk (runtime: a, main) default/async-xxx.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{74}> <{753}> ={581}= [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] default (Rspack x.x.x) compiled successfully all-chunks: - Entrypoint main 9.42 KiB = all-chunks/main.js - Entrypoint a 12.3 KiB = all-chunks/418.js 335 bytes all-chunks/310.js 335 bytes all-chunks/753.js 335 bytes all-chunks/697.js 335 bytes all-chunks/a.js 10.9 KiB - Entrypoint b 6.36 KiB = all-chunks/418.js 335 bytes all-chunks/310.js 335 bytes all-chunks/753.js 335 bytes all-chunks/581.js 335 bytes all-chunks/b.js 5.05 KiB - Entrypoint c 6.35 KiB = all-chunks/418.js 335 bytes all-chunks/416.js 335 bytes all-chunks/753.js 335 bytes all-chunks/581.js 335 bytes all-chunks/c.js 5.05 KiB - chunk (runtime: main) all-chunks/async-c.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] + Entrypoint main xx KiB = all-xxx.js + Entrypoint a xx KiB = all-xxx.js xx KiB + Entrypoint b xx KiB = all-xxx.js xx KiB + Entrypoint c xx KiB = all-xxx.js xx KiB + chunk (runtime: main) all-xxx.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) all-chunks/async-a.js (async-a) 165 bytes <{909}> ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [rendered] + chunk (runtime: main) all-xxx.js (async-a) 165 bytes <{909}> ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [rendered] > ./a ./index.js 1:0-47 ./a.js 165 bytes [built] [code generated] - chunk (runtime: main) all-chunks/async-b.js (async-b) 116 bytes <{909}> ={310}= ={418}= ={581}= ={753}= [rendered] + chunk (runtime: main) all-xxx.js (async-b) 116 bytes <{909}> ={310}= ={418}= ={581}= ={753}= [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] - chunk (runtime: a, b, main) all-chunks/310.js (id hint: vendors) 20 bytes <{909}> ={250}= ={262}= ={418}= ={581}= ={697}= ={74}= ={751}= ={753}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: a, b, main) all-xxx.js (id hint: vendors) 20 bytes <{909}> ={250}= ={262}= ={418}= ={581}= ={697}= ={74}= ={751}= ={753}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./a a > ./b b ./node_modules/y.js 20 bytes [built] [code generated] - chunk (runtime: c, main) all-chunks/416.js (id hint: vendors) 20 bytes <{909}> ={172}= ={418}= ={581}= ={753}= ={76}= [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: c, main) all-xxx.js (id hint: vendors) 20 bytes <{909}> ={172}= ={418}= ={581}= ={753}= ={76}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./c ./index.js 3:0-47 > ./c c ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: a, b, c, main) all-chunks/418.js (id hint: vendors) 20 bytes <{909}> ={172}= ={250}= ={262}= ={310}= ={416}= ={581}= ={697}= ={74}= ={751}= ={753}= ={76}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: a, b, c, main) all-xxx.js (id hint: vendors) 20 bytes <{909}> ={172}= ={250}= ={262}= ={310}= ={416}= ={581}= ={697}= ={74}= ={751}= ={753}= ={76}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -1901,24 +1901,24 @@ all-chunks: > ./b b > ./c c ./node_modules/x.js 20 bytes [built] [code generated] - chunk (runtime: a, b, c, main) all-chunks/581.js (id hint: ) 20 bytes <{250}> <{310}> <{418}> <{697}> <{74}> <{753}> <{909}> ={172}= ={262}= ={310}= ={416}= ={418}= ={751}= ={753}= ={76}= ={912}= [initial] [rendered] split chunk (cache group: default) + chunk (runtime: a, b, c, main) all-xxx.js (id hint: ) 20 bytes <{250}> <{310}> <{418}> <{697}> <{74}> <{753}> <{909}> ={172}= ={262}= ={310}= ={416}= ={418}= ={751}= ={753}= ={76}= ={912}= [initial] [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 > ./g ./a.js 6:0-47 > ./b b > ./c c ./f.js 20 bytes [built] [code generated] - chunk (runtime: a, main) all-chunks/697.js (id hint: ) 20 bytes <{909}> ={250}= ={310}= ={418}= ={74}= ={753}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) + chunk (runtime: a, main) all-xxx.js (id hint: ) 20 bytes <{909}> ={250}= ={310}= ={418}= ={74}= ={753}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./a a ./e.js 20 bytes [built] [code generated] - chunk (runtime: a) all-chunks/a.js (a) 165 bytes (javascript) 8.3 KiB (runtime) ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [entry] [rendered] + chunk (runtime: a) all-xxx.js (a) 165 bytes (javascript) xx KiB (runtime) ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [entry] [rendered] > ./a a ./a.js 165 bytes [built] [code generated] - chunk (runtime: b) all-chunks/b.js (b) 116 bytes (javascript) 2.86 KiB (runtime) ={310}= ={418}= ={581}= ={753}= [entry] [rendered] + chunk (runtime: b) all-xxx.js (b) 116 bytes (javascript) xx KiB (runtime) ={310}= ={418}= ={581}= ={753}= [entry] [rendered] > ./b b ./b.js 116 bytes [built] [code generated] - chunk (runtime: a, b, c, main) all-chunks/753.js (id hint: ) 20 bytes <{909}> ={172}= ={250}= ={262}= ={310}= ={416}= ={418}= ={581}= ={697}= ={74}= ={751}= ={76}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) + chunk (runtime: a, b, c, main) all-xxx.js (id hint: ) 20 bytes <{909}> ={172}= ={250}= ={262}= ={310}= ={416}= ={418}= ={581}= ={697}= ={74}= ={751}= ={76}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -1926,23 +1926,23 @@ all-chunks: > ./b b > ./c c ./d.js 20 bytes [built] [code generated] - chunk (runtime: c) all-chunks/c.js (c) 116 bytes (javascript) 2.86 KiB (runtime) ={416}= ={418}= ={581}= ={753}= [entry] [rendered] + chunk (runtime: c) all-xxx.js (c) 116 bytes (javascript) xx KiB (runtime) ={416}= ={418}= ={581}= ={753}= [entry] [rendered] > ./c c ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) all-chunks/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{697}< >{753}< [entry] [rendered] + chunk (runtime: main) all-xxx.js (main) 147 bytes (javascript) xx KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{697}< >{753}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, main) all-chunks/async-g.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{697}> <{74}> <{753}> ={581}= [rendered] + chunk (runtime: a, main) all-xxx.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{697}> <{74}> <{753}> ={581}= [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] all-chunks (Rspack x.x.x) compiled successfully manual: - Entrypoint main 9.16 KiB = manual/main.js - Entrypoint a 12 KiB = manual/vendors.js 829 bytes manual/a.js 11.2 KiB - Entrypoint b 6.58 KiB = manual/vendors.js 829 bytes manual/b.js 5.78 KiB - Entrypoint c 6.58 KiB = manual/vendors.js 829 bytes manual/c.js 5.77 KiB - chunk (runtime: main) manual/async-c.js (async-c) 156 bytes <{909}> ={192}= [rendered] + Entrypoint main xx KiB = manual/main.js + Entrypoint a xx KiB = manual/vendors.js 829 bytes manual/a.js xx KiB + Entrypoint b xx KiB = manual/vendors.js 829 bytes manual/b.js xx KiB + Entrypoint c xx KiB = manual/vendors.js 829 bytes manual/c.js xx KiB + chunk (runtime: main) manual/async-xxx.js (async-c) 156 bytes <{909}> ={192}= [rendered] > ./c ./index.js 3:0-47 dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] @@ -1965,75 +1965,75 @@ manual: ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: main) manual/async-a.js (async-a) 205 bytes <{909}> ={192}= >{912}< [rendered] + chunk (runtime: main) manual/async-xxx.js (async-a) 205 bytes <{909}> ={192}= >{912}< [rendered] > ./a ./index.js 1:0-47 dependent modules 20 bytes [dependent] 1 module ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: main) manual/async-b.js (async-b) 156 bytes <{909}> ={192}= [rendered] + chunk (runtime: main) manual/async-xxx.js (async-b) 156 bytes <{909}> ={192}= [rendered] > ./b ./index.js 2:0-47 dependent modules 40 bytes [dependent] 2 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: a) manual/a.js (a) 205 bytes (javascript) 8.27 KiB (runtime) ={192}= >{912}< [entry] [rendered] + chunk (runtime: a) manual/a.js (a) 205 bytes (javascript) xx KiB (runtime) ={192}= >{912}< [entry] [rendered] > ./a a > x a > y a > z a dependent modules 20 bytes [dependent] 1 module ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: b) manual/b.js (b) 156 bytes (javascript) 2.86 KiB (runtime) ={192}= [entry] [rendered] + chunk (runtime: b) manual/b.js (b) 156 bytes (javascript) xx KiB (runtime) ={192}= [entry] [rendered] > ./b b > x b > y b > z b dependent modules 40 bytes [dependent] 2 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: c) manual/c.js (c) 156 bytes (javascript) 2.86 KiB (runtime) ={192}= [entry] [rendered] + chunk (runtime: c) manual/c.js (c) 156 bytes (javascript) xx KiB (runtime) ={192}= [entry] [rendered] > ./c c > x c > y c > z c dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) manual/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) >{172}< >{192}< >{250}< >{262}< [entry] [rendered] + chunk (runtime: main) manual/main.js (main) 147 bytes (javascript) xx KiB (runtime) >{172}< >{192}< >{250}< >{262}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, main) manual/async-g.js (async-g) 65 bytes <{192}> <{250}> <{74}> [rendered] + chunk (runtime: a, main) manual/async-xxx.js (async-g) 65 bytes <{192}> <{250}> <{74}> [rendered] > ./g ./a.js 6:0-47 dependent modules 20 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] manual (Rspack x.x.x) compiled successfully name-too-long: - Entrypoint main 9.42 KiB = name-too-long/main.js - Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 12.3 KiB = name-too-long/418.js 335 bytes name-too-long/310.js 335 bytes name-too-long/753.js 335 bytes name-too-long/697.js 335 bytes name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js 10.9 KiB - Entrypoint bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 6.36 KiB = name-too-long/418.js 335 bytes name-too-long/310.js 335 bytes name-too-long/753.js 335 bytes name-too-long/581.js 335 bytes name-too-long/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js 5.05 KiB - Entrypoint cccccccccccccccccccccccccccccc 6.36 KiB = name-too-long/418.js 335 bytes name-too-long/416.js 335 bytes name-too-long/753.js 335 bytes name-too-long/581.js 335 bytes name-too-long/cccccccccccccccccccccccccccccc.js 5.05 KiB - chunk (runtime: main) name-too-long/async-c.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] + Entrypoint main xx KiB = name-xxx.js + Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa xx KiB = name-xxx.js xx KiB + Entrypoint bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb xx KiB = name-xxx.js xx KiB + Entrypoint cccccccccccccccccccccccccccccc xx KiB = name-xxx.js xx KiB + chunk (runtime: main) name-xxx.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) name-too-long/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 116 bytes (javascript) 2.86 KiB (runtime) ={310}= ={418}= ={581}= ={753}= [entry] [rendered] + chunk (runtime: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) name-xxx.js (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 116 bytes (javascript) xx KiB (runtime) ={310}= ={418}= ={581}= ={753}= [entry] [rendered] > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ./b.js 116 bytes [built] [code generated] - chunk (runtime: main) name-too-long/async-a.js (async-a) 165 bytes <{909}> ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [rendered] + chunk (runtime: main) name-xxx.js (async-a) 165 bytes <{909}> ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [rendered] > ./a ./index.js 1:0-47 ./a.js 165 bytes [built] [code generated] - chunk (runtime: main) name-too-long/async-b.js (async-b) 116 bytes <{909}> ={310}= ={418}= ={581}= ={753}= [rendered] + chunk (runtime: main) name-xxx.js (async-b) 116 bytes <{909}> ={310}= ={418}= ={581}= ={753}= [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, main) name-too-long/310.js (id hint: vendors) 20 bytes <{909}> ={225}= ={250}= ={262}= ={418}= ={581}= ={697}= ={753}= ={959}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, main) name-xxx.js (id hint: vendors) 20 bytes <{909}> ={225}= ={250}= ={262}= ={418}= ={581}= ={697}= ={753}= ={959}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ./node_modules/y.js 20 bytes [built] [code generated] - chunk (runtime: cccccccccccccccccccccccccccccc) name-too-long/cccccccccccccccccccccccccccccc.js (cccccccccccccccccccccccccccccc) 116 bytes (javascript) 2.86 KiB (runtime) ={416}= ={418}= ={581}= ={753}= [entry] [rendered] + chunk (runtime: cccccccccccccccccccccccccccccc) name-xxx.js (cccccccccccccccccccccccccccccc) 116 bytes (javascript) xx KiB (runtime) ={416}= ={418}= ={581}= ={753}= [entry] [rendered] > ./c cccccccccccccccccccccccccccccc ./c.js 116 bytes [built] [code generated] - chunk (runtime: cccccccccccccccccccccccccccccc, main) name-too-long/416.js (id hint: vendors) 20 bytes <{909}> ={172}= ={325}= ={418}= ={581}= ={753}= [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: cccccccccccccccccccccccccccccc, main) name-xxx.js (id hint: vendors) 20 bytes <{909}> ={172}= ={325}= ={418}= ={581}= ={753}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./c ./index.js 3:0-47 > ./c cccccccccccccccccccccccccccccc ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-too-long/418.js (id hint: vendors) 20 bytes <{909}> ={172}= ={225}= ={250}= ={262}= ={310}= ={325}= ={416}= ={581}= ={697}= ={753}= ={959}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-xxx.js (id hint: vendors) 20 bytes <{909}> ={172}= ={225}= ={250}= ={262}= ={310}= ={325}= ={416}= ={581}= ={697}= ={753}= ={959}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -2041,18 +2041,18 @@ name-too-long: > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > ./c cccccccccccccccccccccccccccccc ./node_modules/x.js 20 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-too-long/581.js (id hint: ) 20 bytes <{250}> <{310}> <{418}> <{697}> <{753}> <{909}> <{959}> ={172}= ={225}= ={262}= ={310}= ={325}= ={416}= ={418}= ={753}= ={912}= [initial] [rendered] split chunk (cache group: default) + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-xxx.js (id hint: ) 20 bytes <{250}> <{310}> <{418}> <{697}> <{753}> <{909}> <{959}> ={172}= ={225}= ={262}= ={310}= ={325}= ={416}= ={418}= ={753}= ={912}= [initial] [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 > ./g ./a.js 6:0-47 > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > ./c cccccccccccccccccccccccccccccc ./f.js 20 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, main) name-too-long/697.js (id hint: ) 20 bytes <{909}> ={250}= ={310}= ={418}= ={753}= ={959}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, main) name-xxx.js (id hint: ) 20 bytes <{909}> ={250}= ={310}= ={418}= ={753}= ={959}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ./e.js 20 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-too-long/753.js (id hint: ) 20 bytes <{909}> ={172}= ={225}= ={250}= ={262}= ={310}= ={325}= ={416}= ={418}= ={581}= ={697}= ={959}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-xxx.js (id hint: ) 20 bytes <{909}> ={172}= ={225}= ={250}= ={262}= ={310}= ={325}= ={416}= ={418}= ={581}= ={697}= ={959}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -2060,89 +2060,89 @@ name-too-long: > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > ./c cccccccccccccccccccccccccccccc ./d.js 20 bytes [built] [code generated] - chunk (runtime: main) name-too-long/main.js (main) 147 bytes (javascript) 7.27 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{697}< >{753}< [entry] [rendered] + chunk (runtime: main) name-xxx.js (main) 147 bytes (javascript) xx KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{697}< >{753}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, main) name-too-long/async-g.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{697}> <{753}> <{959}> ={581}= [rendered] + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, main) name-xxx.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{697}> <{753}> <{959}> ={581}= [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 165 bytes (javascript) 8.31 KiB (runtime) ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [entry] [rendered] + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) name-xxx.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 165 bytes (javascript) xx KiB (runtime) ={310}= ={418}= ={697}= ={753}= >{581}< >{912}< [entry] [rendered] > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ./a.js 165 bytes [built] [code generated] name-too-long (Rspack x.x.x) compiled successfully custom-chunks-filter: - Entrypoint main 9.4 KiB = custom-chunks-filter/main.js - Entrypoint a 10.1 KiB = custom-chunks-filter/a.js - Entrypoint b 6.36 KiB = custom-chunks-filter/418.js 335 bytes custom-chunks-filter/310.js 335 bytes custom-chunks-filter/581.js 335 bytes custom-chunks-filter/753.js 335 bytes custom-chunks-filter/b.js 5.05 KiB - Entrypoint c 6.35 KiB = custom-chunks-filter/418.js 335 bytes custom-chunks-filter/416.js 335 bytes custom-chunks-filter/581.js 335 bytes custom-chunks-filter/753.js 335 bytes custom-chunks-filter/c.js 5.05 KiB - chunk (runtime: main) custom-chunks-filter/async-c.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] + Entrypoint main xx KiB = custom-xxx.js + Entrypoint a xx KiB = custom-xxx.js + Entrypoint b xx KiB = custom-xxx.js xx KiB + Entrypoint c xx KiB = custom-xxx.js xx KiB + chunk (runtime: main) custom-xxx.js (async-c) 116 bytes <{909}> ={416}= ={418}= ={581}= ={753}= [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter/async-a.js (async-a) 185 bytes <{909}> ={310}= ={418}= ={753}= >{581}< >{912}< [rendered] + chunk (runtime: main) custom-xxx.js (async-a) 185 bytes <{909}> ={310}= ={418}= ={753}= >{581}< >{912}< [rendered] > ./a ./index.js 1:0-47 ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: main) custom-chunks-filter/async-b.js (async-b) 116 bytes <{909}> ={310}= ={418}= ={581}= ={753}= [rendered] + chunk (runtime: main) custom-xxx.js (async-b) 116 bytes <{909}> ={310}= ={418}= ={581}= ={753}= [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] - chunk (runtime: b, main) custom-chunks-filter/310.js (id hint: vendors) 20 bytes <{909}> ={250}= ={262}= ={418}= ={581}= ={751}= ={753}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: b, main) custom-xxx.js (id hint: vendors) 20 bytes <{909}> ={250}= ={262}= ={418}= ={581}= ={751}= ={753}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./b b ./node_modules/y.js 20 bytes [built] [code generated] - chunk (runtime: c, main) custom-chunks-filter/416.js (id hint: vendors) 20 bytes <{909}> ={172}= ={418}= ={581}= ={753}= ={76}= [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: c, main) custom-xxx.js (id hint: vendors) 20 bytes <{909}> ={172}= ={418}= ={581}= ={753}= ={76}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./c ./index.js 3:0-47 > ./c c ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: b, c, main) custom-chunks-filter/418.js (id hint: vendors) 20 bytes <{909}> ={172}= ={250}= ={262}= ={310}= ={416}= ={581}= ={751}= ={753}= ={76}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: b, c, main) custom-xxx.js (id hint: vendors) 20 bytes <{909}> ={172}= ={250}= ={262}= ={310}= ={416}= ={581}= ={751}= ={753}= ={76}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 > ./b b > ./c c ./node_modules/x.js 20 bytes [built] [code generated] - chunk (runtime: a, b, c, main) custom-chunks-filter/581.js (id hint: ) 20 bytes <{250}> <{310}> <{418}> <{74}> <{753}> <{909}> ={172}= ={262}= ={310}= ={416}= ={418}= ={751}= ={753}= ={76}= ={912}= [initial] [rendered] split chunk (cache group: default) + chunk (runtime: a, b, c, main) custom-xxx.js (id hint: ) 20 bytes <{250}> <{310}> <{418}> <{74}> <{753}> <{909}> ={172}= ={262}= ={310}= ={416}= ={418}= ={751}= ={753}= ={76}= ={912}= [initial] [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 > ./g ./a.js 6:0-47 > ./b b > ./c c ./f.js 20 bytes [built] [code generated] - chunk (runtime: a) custom-chunks-filter/a.js (a) 245 bytes (javascript) 7.23 KiB (runtime) >{581}< >{912}< [entry] [rendered] + chunk (runtime: a) custom-xxx.js (a) 245 bytes (javascript) xx KiB (runtime) >{581}< >{912}< [entry] [rendered] > ./a a dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: b) custom-chunks-filter/b.js (b) 116 bytes (javascript) 2.86 KiB (runtime) ={310}= ={418}= ={581}= ={753}= [entry] [rendered] + chunk (runtime: b) custom-xxx.js (b) 116 bytes (javascript) xx KiB (runtime) ={310}= ={418}= ={581}= ={753}= [entry] [rendered] > ./b b ./b.js 116 bytes [built] [code generated] - chunk (runtime: b, c, main) custom-chunks-filter/753.js (id hint: ) 20 bytes <{909}> ={172}= ={250}= ={262}= ={310}= ={416}= ={418}= ={581}= ={751}= ={76}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) + chunk (runtime: b, c, main) custom-xxx.js (id hint: ) 20 bytes <{909}> ={172}= ={250}= ={262}= ={310}= ={416}= ={418}= ={581}= ={751}= ={76}= >{581}< >{912}< [initial] [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 > ./b b > ./c c ./d.js 20 bytes [built] [code generated] - chunk (runtime: c) custom-chunks-filter/c.js (c) 116 bytes (javascript) 2.86 KiB (runtime) ={416}= ={418}= ={581}= ={753}= [entry] [rendered] + chunk (runtime: c) custom-xxx.js (c) 116 bytes (javascript) xx KiB (runtime) ={416}= ={418}= ={581}= ={753}= [entry] [rendered] > ./c c ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter/main.js (main) 147 bytes (javascript) 7.28 KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{753}< [entry] [rendered] + chunk (runtime: main) custom-xxx.js (main) 147 bytes (javascript) xx KiB (runtime) >{172}< >{250}< >{262}< >{310}< >{416}< >{418}< >{581}< >{753}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, main) custom-chunks-filter/async-g.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{74}> <{753}> ={581}= [rendered] + chunk (runtime: a, main) custom-xxx.js (async-g) 45 bytes <{250}> <{310}> <{418}> <{74}> <{753}> ={581}= [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] custom-chunks-filter (Rspack x.x.x) compiled successfully custom-chunks-filter-in-cache-groups: - Entrypoint main 9.18 KiB = custom-chunks-filter-in-cache-groups/main.js - Entrypoint a 11.9 KiB = custom-chunks-filter-in-cache-groups/598.js 680 bytes custom-chunks-filter-in-cache-groups/a.js 11.2 KiB - Entrypoint b 6.58 KiB = custom-chunks-filter-in-cache-groups/vendors.js 829 bytes custom-chunks-filter-in-cache-groups/b.js 5.78 KiB - Entrypoint c 6.58 KiB = custom-chunks-filter-in-cache-groups/vendors.js 829 bytes custom-chunks-filter-in-cache-groups/c.js 5.77 KiB - chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-c.js (async-c) 156 bytes <{909}> ={192}= [rendered] + Entrypoint main xx KiB = custom-xxx.js + Entrypoint a xx KiB = custom-xxx.js xx KiB + Entrypoint b xx KiB = custom-xxx.js xx KiB + Entrypoint c xx KiB = custom-xxx.js xx KiB + chunk (runtime: main) custom-xxx.js (async-c) 156 bytes <{909}> ={192}= [rendered] > ./c ./index.js 3:0-47 dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: b, c, main) custom-chunks-filter-in-cache-groups/vendors.js (vendors) (id hint: vendors) 60 bytes <{909}> ={172}= ={250}= ={262}= ={751}= ={76}= >{912}< [initial] [rendered] split chunk (cache group: vendors) + chunk (runtime: b, c, main) custom-xxx.js (vendors) (id hint: vendors) 60 bytes <{909}> ={172}= ={250}= ={262}= ={751}= ={76}= >{912}< [initial] [rendered] split chunk (cache group: vendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -2157,15 +2157,15 @@ custom-chunks-filter-in-cache-groups: ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-a.js (async-a) 205 bytes <{909}> ={192}= >{912}< [rendered] + chunk (runtime: main) custom-xxx.js (async-a) 205 bytes <{909}> ={192}= >{912}< [rendered] > ./a ./index.js 1:0-47 dependent modules 20 bytes [dependent] 1 module ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-b.js (async-b) 156 bytes <{909}> ={192}= [rendered] + chunk (runtime: main) custom-xxx.js (async-b) 156 bytes <{909}> ={192}= [rendered] > ./b ./index.js 2:0-47 dependent modules 40 bytes [dependent] 2 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: a) custom-chunks-filter-in-cache-groups/598.js (id hint: vendors) 60 bytes ={74}= >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: a) custom-xxx.js (id hint: vendors) 60 bytes ={74}= >{912}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a a > x a > y a @@ -2173,31 +2173,31 @@ custom-chunks-filter-in-cache-groups: ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: a) custom-chunks-filter-in-cache-groups/a.js (a) 205 bytes (javascript) 8.3 KiB (runtime) ={598}= >{912}< [entry] [rendered] + chunk (runtime: a) custom-xxx.js (a) 205 bytes (javascript) xx KiB (runtime) ={598}= >{912}< [entry] [rendered] > ./a a > x a > y a > z a dependent modules 20 bytes [dependent] 1 module ./a.js + 1 modules 185 bytes [code generated] - chunk (runtime: b) custom-chunks-filter-in-cache-groups/b.js (b) 156 bytes (javascript) 2.86 KiB (runtime) ={192}= [entry] [rendered] + chunk (runtime: b) custom-xxx.js (b) 156 bytes (javascript) xx KiB (runtime) ={192}= [entry] [rendered] > ./b b > x b > y b > z b dependent modules 40 bytes [dependent] 2 modules ./b.js 116 bytes [built] [code generated] - chunk (runtime: c) custom-chunks-filter-in-cache-groups/c.js (c) 156 bytes (javascript) 2.86 KiB (runtime) ={192}= [entry] [rendered] + chunk (runtime: c) custom-xxx.js (c) 156 bytes (javascript) xx KiB (runtime) ={192}= [entry] [rendered] > ./c c > x c > y c > z c dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter-in-cache-groups/main.js (main) 147 bytes (javascript) 7.3 KiB (runtime) >{172}< >{192}< >{250}< >{262}< [entry] [rendered] + chunk (runtime: main) custom-xxx.js (main) 147 bytes (javascript) xx KiB (runtime) >{172}< >{192}< >{250}< >{262}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, main) custom-chunks-filter-in-cache-groups/async-g.js (async-g) 65 bytes <{192}> <{250}> <{598}> <{74}> [rendered] + chunk (runtime: a, main) custom-xxx.js (async-g) 65 bytes <{192}> <{250}> <{598}> <{74}> [rendered] > ./g ./a.js 6:0-47 dependent modules 20 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] @@ -2205,75 +2205,75 @@ custom-chunks-filter-in-cache-groups: `; exports[`StatsTestCases should print correct stats for split-chunks-automatic-name 1`] = ` -"Entrypoint main 9.46 KiB = main.js -chunk (runtime: main) async-a.js (async-a) (id hint: common) 136 bytes <{main}> ={common-d_js}= ={common-node_modules_x_js}= ={common-node_modules_y_js}= [rendered] +"Entrypoint main xx KiB = main.js +chunk (runtime: main) async-xxx.js (async-a) (id hint: common) 136 bytes <{main}> ={common-d_js}= ={common-node_modules_x_js}= ={common-node_modules_y_js}= [rendered] > ./a ./index.js 1:0-47 ./a.js + 1 modules 136 bytes [code generated] -chunk (runtime: main) async-b.js (async-b) (id hint: common) 116 bytes <{main}> ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= ={common-node_modules_y_js}= [rendered] +chunk (runtime: main) async-xxx.js (async-b) (id hint: common) 116 bytes <{main}> ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= ={common-node_modules_y_js}= [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] -chunk (runtime: main) async-c.js (async-c) (id hint: common) 116 bytes <{main}> ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= ={common-node_modules_z_js}= [rendered] +chunk (runtime: main) async-xxx.js (async-c) (id hint: common) 116 bytes <{main}> ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= ={common-node_modules_z_js}= [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] -chunk (runtime: main) common-d_js.js (id hint: common) 20 bytes <{main}> ={async-a}= ={async-b}= ={async-c}= ={common-f_js}= ={common-node_modules_x_js}= ={common-node_modules_y_js}= ={common-node_modules_z_js}= [rendered] split chunk (cache group: a) +chunk (runtime: main) common-xxx.js (id hint: common) 20 bytes <{main}> ={async-a}= ={async-b}= ={async-c}= ={common-f_js}= ={common-node_modules_x_js}= ={common-node_modules_y_js}= ={common-node_modules_z_js}= [rendered] split chunk (cache group: a) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 ./d.js 20 bytes [built] [code generated] -chunk (runtime: main) common-f_js.js (id hint: common) 20 bytes <{main}> ={async-b}= ={async-c}= ={common-d_js}= ={common-node_modules_x_js}= ={common-node_modules_y_js}= ={common-node_modules_z_js}= [rendered] split chunk (cache group: a) +chunk (runtime: main) common-xxx.js (id hint: common) 20 bytes <{main}> ={async-b}= ={async-c}= ={common-d_js}= ={common-node_modules_x_js}= ={common-node_modules_y_js}= ={common-node_modules_z_js}= [rendered] split chunk (cache group: a) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 ./f.js 20 bytes [built] [code generated] -chunk (runtime: main) common-node_modules_x_js.js (id hint: common) 20 bytes <{main}> ={async-a}= ={async-b}= ={async-c}= ={common-d_js}= ={common-f_js}= ={common-node_modules_y_js}= ={common-node_modules_z_js}= [rendered] split chunk (cache group: b) +chunk (runtime: main) common-xxx.js (id hint: common) 20 bytes <{main}> ={async-a}= ={async-b}= ={async-c}= ={common-d_js}= ={common-f_js}= ={common-node_modules_y_js}= ={common-node_modules_z_js}= [rendered] split chunk (cache group: b) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 ./node_modules/x.js 20 bytes [built] [code generated] -chunk (runtime: main) common-node_modules_y_js.js (id hint: common) 20 bytes <{main}> ={async-a}= ={async-b}= ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= [rendered] split chunk (cache group: b) +chunk (runtime: main) common-xxx.js (id hint: common) 20 bytes <{main}> ={async-a}= ={async-b}= ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= [rendered] split chunk (cache group: b) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./node_modules/y.js 20 bytes [built] [code generated] -chunk (runtime: main) common-node_modules_z_js.js (id hint: common) 20 bytes <{main}> ={async-c}= ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= [rendered] split chunk (cache group: b) +chunk (runtime: main) common-xxx.js (id hint: common) 20 bytes <{main}> ={async-c}= ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= [rendered] split chunk (cache group: b) > ./c ./index.js 3:0-47 ./node_modules/z.js 20 bytes [built] [code generated] -chunk (runtime: main) main.js (main) (id hint: common) 147 bytes (javascript) 7.17 KiB (runtime) >{async-a}< >{async-b}< >{async-c}< >{common-d_js}< >{common-f_js}< >{common-node_modules_x_js}< >{common-node_modules_y_js}< >{common-node_modules_z_js}< [entry] [rendered] +chunk (runtime: main) main.js (main) (id hint: common) 147 bytes (javascript) xx KiB (runtime) >{async-a}< >{async-b}< >{async-c}< >{common-d_js}< >{common-f_js}< >{common-node_modules_x_js}< >{common-node_modules_y_js}< >{common-node_modules_z_js}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] production (Rspack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-chunk-name 1`] = ` -"Entrypoint main 9.11 KiB = default/main.js -chunk (runtime: main) default/async-a.js (async-a) 20 bytes <{909}> [rendered] +"Entrypoint main xx KiB = default/main.js +chunk (runtime: main) default/async-xxx.js (async-a) 20 bytes <{909}> [rendered] > a ./index.js 1:0-45 ./node_modules/a.js 20 bytes [built] [code generated] -chunk (runtime: main) default/async-b.js (async-b) (id hint: vendors) 122 bytes <{909}> [rendered] +chunk (runtime: main) default/async-xxx.js (async-b) (id hint: vendors) 122 bytes <{909}> [rendered] > b ./index.js 2:0-45 ./node_modules/b.js 122 bytes [built] [code generated] -chunk (runtime: main) default/async-c-1.js (async-c-1) (id hint: vendors) 122 bytes <{909}> [rendered] +chunk (runtime: main) default/async-xxx.js (async-c-1) (id hint: vendors) 122 bytes <{909}> [rendered] > c ./index.js 3:0-47 > c ./index.js 4:0-47 ./node_modules/c.js 122 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 192 bytes (javascript) 7.24 KiB (runtime) >{250}< >{262}< >{589}< [entry] [rendered] +chunk (runtime: main) default/main.js (main) 192 bytes (javascript) xx KiB (runtime) >{250}< >{262}< >{589}< [entry] [rendered] > ./ main ./index.js 192 bytes [built] [code generated] Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-combinations 1`] = ` -"Entrypoint main 9.58 KiB = main.js -chunk (runtime: main) async-c.js (async-c) 132 bytes <{909}> [rendered] +"Entrypoint main xx KiB = main.js +chunk (runtime: main) async-xxx.js (async-c) 132 bytes <{909}> [rendered] > ./c ./index.js 3:0-47 dependent modules 87 bytes [dependent] 1 module ./c.js 45 bytes [built] [code generated] -chunk (runtime: main) async-f.js (async-f) 132 bytes <{909}> [rendered] +chunk (runtime: main) async-xxx.js (async-f) 132 bytes <{909}> [rendered] > ./f ./index.js 6:0-47 dependent modules 87 bytes [dependent] 1 module ./f.js 45 bytes [built] [code generated] -chunk (runtime: main) async-a.js (async-a) 70 bytes <{909}> ={36}= [rendered] +chunk (runtime: main) async-xxx.js (async-a) 70 bytes <{909}> ={36}= [rendered] > ./a ./index.js 1:0-47 ./a.js 70 bytes [built] [code generated] -chunk (runtime: main) async-b.js (async-b) 70 bytes <{909}> ={36}= [rendered] +chunk (runtime: main) async-xxx.js (async-b) 70 bytes <{909}> ={36}= [rendered] > ./b ./index.js 2:0-47 ./b.js 70 bytes [built] [code generated] chunk (runtime: main) 36.js (id hint: ) 174 bytes <{909}> ={250}= ={262}= [rendered] split chunk (cache group: default) @@ -2281,18 +2281,18 @@ chunk (runtime: main) 36.js (id hint: ) 174 bytes <{909}> ={250}= ={262}= [rende > ./b ./index.js 2:0-47 ./x.js 87 bytes [built] [code generated] ./y.js 87 bytes [built] [code generated] -chunk (runtime: main) async-e.js (async-e) 132 bytes <{909}> [rendered] +chunk (runtime: main) async-xxx.js (async-e) 132 bytes <{909}> [rendered] > ./e ./index.js 5:0-47 dependent modules 87 bytes [dependent] 1 module ./e.js 45 bytes [built] [code generated] -chunk (runtime: main) async-d.js (async-d) 132 bytes <{909}> [rendered] +chunk (runtime: main) async-xxx.js (async-d) 132 bytes <{909}> [rendered] > ./d ./index.js 4:0-47 dependent modules 87 bytes [dependent] 1 module ./d.js 45 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 343 bytes (javascript) 7.3 KiB (runtime) >{172}< >{198}< >{250}< >{262}< >{36}< >{407}< >{602}< >{912}< [entry] [rendered] +chunk (runtime: main) main.js (main) 343 bytes (javascript) xx KiB (runtime) >{172}< >{198}< >{250}< >{262}< >{36}< >{407}< >{602}< >{912}< [entry] [rendered] > ./ main ./index.js 343 bytes [built] [code generated] -chunk (runtime: main) async-g.js (async-g) 132 bytes <{909}> [rendered] +chunk (runtime: main) async-xxx.js (async-g) 132 bytes <{909}> [rendered] > ./g ./index.js 7:0-47 dependent modules 87 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] @@ -2300,14 +2300,14 @@ Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-issue-6413 1`] = ` -"Entrypoint main 9.21 KiB = main.js -chunk (runtime: main) async-c.js (async-c) 36 bytes <{909}> ={306}= ={418}= [rendered] +"Entrypoint main xx KiB = main.js +chunk (runtime: main) async-xxx.js (async-c) 36 bytes <{909}> ={306}= ={418}= [rendered] > ./c ./index.js 3:0-47 ./c.js 36 bytes [built] [code generated] -chunk (runtime: main) async-a.js (async-a) 36 bytes <{909}> ={306}= ={418}= [rendered] +chunk (runtime: main) async-xxx.js (async-a) 36 bytes <{909}> ={306}= ={418}= [rendered] > ./a ./index.js 1:0-47 ./a.js 36 bytes [built] [code generated] -chunk (runtime: main) async-b.js (async-b) 36 bytes <{909}> ={306}= ={418}= [rendered] +chunk (runtime: main) async-xxx.js (async-b) 36 bytes <{909}> ={306}= ={418}= [rendered] > ./b ./index.js 2:0-47 ./b.js 36 bytes [built] [code generated] chunk (runtime: main) 306.js (id hint: ) 45 bytes <{909}> ={172}= ={250}= ={262}= ={418}= [rendered] split chunk (cache group: default) @@ -2320,43 +2320,43 @@ chunk (runtime: main) 418.js (id hint: vendors) 20 bytes <{909}> ={172}= ={250}= > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 ./node_modules/x.js 20 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 147 bytes (javascript) 7.23 KiB (runtime) >{172}< >{250}< >{262}< >{306}< >{418}< [entry] [rendered] +chunk (runtime: main) main.js (main) 147 bytes (javascript) xx KiB (runtime) >{172}< >{250}< >{262}< >{306}< >{418}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] default (Rspack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-issue-6696 1`] = ` -"Entrypoint main 10.9 KiB = vendors.js 335 bytes main.js 10.5 KiB +"Entrypoint main xx KiB = vendors.js 335 bytes main.js xx KiB chunk (runtime: main) vendors.js (vendors) (id hint: vendors) 20 bytes ={909}= >{250}< >{262}< [initial] [rendered] split chunk (cache group: vendors) > ./ main ./node_modules/y.js 20 bytes [built] [code generated] -chunk (runtime: main) async-a.js (async-a) 49 bytes <{192}> <{909}> [rendered] +chunk (runtime: main) async-xxx.js (async-a) 49 bytes <{192}> <{909}> [rendered] > ./a ./index.js 2:0-47 dependent modules 20 bytes [dependent] 1 module ./a.js 29 bytes [built] [code generated] -chunk (runtime: main) async-b.js (async-b) 49 bytes <{192}> <{909}> [rendered] +chunk (runtime: main) async-xxx.js (async-b) 49 bytes <{192}> <{909}> [rendered] > ./b ./index.js 3:0-47 dependent modules 20 bytes [dependent] 1 module ./b.js 29 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 134 bytes (javascript) 8.29 KiB (runtime) ={192}= >{250}< >{262}< [entry] [rendered] +chunk (runtime: main) main.js (main) 134 bytes (javascript) xx KiB (runtime) ={192}= >{250}< >{262}< [entry] [rendered] > ./ main ./index.js 134 bytes [built] [code generated] default (Rspack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-issue-7401 1`] = ` -"Entrypoint a 4.9 KiB = 418.js 335 bytes a.js 4.58 KiB -Entrypoint b 8.77 KiB = b.js +"Entrypoint a xx KiB = 418.js 335 bytes a.js xx KiB +Entrypoint b xx KiB = b.js Chunk Group c 701 bytes = 418.js 335 bytes c.js 366 bytes chunk (runtime: a, b) 418.js (id hint: vendors) 20 bytes <{751}> ={74}= ={76}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./c ./b.js 1:0-41 > ./a a ./node_modules/x.js 20 bytes [built] [code generated] -chunk (runtime: a) a.js (a) 35 bytes (javascript) 2.86 KiB (runtime) ={418}= [entry] [rendered] +chunk (runtime: a) a.js (a) 35 bytes (javascript) xx KiB (runtime) ={418}= [entry] [rendered] > ./a a ./a.js 35 bytes [built] [code generated] -chunk (runtime: b) b.js (b) 43 bytes (javascript) 7.19 KiB (runtime) >{418}< >{76}< [entry] [rendered] +chunk (runtime: b) b.js (b) 43 bytes (javascript) xx KiB (runtime) >{418}< >{76}< [entry] [rendered] > ./b b ./b.js 43 bytes [built] [code generated] chunk (runtime: b) c.js (c) 35 bytes <{751}> ={418}= [rendered] @@ -2366,14 +2366,14 @@ default (Rspack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-keep-remaining-size 1`] = ` -"Entrypoint main 9.3 KiB = default/main.js -chunk (runtime: main) default/async-c.js (async-c) 50 bytes <{909}> ={44}= [rendered] +"Entrypoint main xx KiB = default/main.js +chunk (runtime: main) default/async-xxx.js (async-c) 50 bytes <{909}> ={44}= [rendered] > ./c ./index.js 3:0-47 ./c.js 50 bytes [built] [code generated] -chunk (runtime: main) default/async-a.js (async-a) 50 bytes <{909}> ={728}= [rendered] +chunk (runtime: main) default/async-xxx.js (async-a) 50 bytes <{909}> ={728}= [rendered] > ./a ./index.js 1:0-47 ./a.js 50 bytes [built] [code generated] -chunk (runtime: main) default/async-b.js (async-b) 50 bytes <{909}> ={44}= [rendered] +chunk (runtime: main) default/async-xxx.js (async-b) 50 bytes <{909}> ={44}= [rendered] > ./b ./index.js 2:0-47 ./b.js 50 bytes [built] [code generated] chunk (runtime: main) default/403.js (id hint: vendors) 252 bytes <{909}> ={602}= [rendered] split chunk (cache group: defaultVendors) @@ -2384,32 +2384,32 @@ chunk (runtime: main) default/44.js (id hint: vendors) 126 bytes <{909}> ={172}= > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 ./node_modules/shared.js?2 126 bytes [built] [code generated] -chunk (runtime: main) default/async-d.js (async-d) 84 bytes <{909}> ={403}= [rendered] +chunk (runtime: main) default/async-xxx.js (async-d) 84 bytes <{909}> ={403}= [rendered] > ./d ./index.js 4:0-47 ./d.js 84 bytes [built] [code generated] chunk (runtime: main) default/728.js (id hint: vendors) 126 bytes <{909}> ={250}= [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 ./node_modules/shared.js?1 126 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 196 bytes (javascript) 7.27 KiB (runtime) >{172}< >{250}< >{262}< >{403}< >{44}< >{602}< >{728}< [entry] [rendered] +chunk (runtime: main) default/main.js (main) 196 bytes (javascript) xx KiB (runtime) >{172}< >{250}< >{262}< >{403}< >{44}< >{602}< >{728}< [entry] [rendered] > ./ main ./index.js 196 bytes [built] [code generated] Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-min-size-reduction 1`] = ` -"Entrypoint main 9.49 KiB = default/main.js -chunk (runtime: main) default/async-c.js (async-c) 50 bytes <{909}> ={44}= [rendered] +"Entrypoint main xx KiB = default/main.js +chunk (runtime: main) default/async-xxx.js (async-c) 50 bytes <{909}> ={44}= [rendered] > ./c ./index.js 3:0-47 ./c.js 50 bytes [built] [code generated] -chunk (runtime: main) default/async-a.js (async-a) 176 bytes <{909}> [rendered] +chunk (runtime: main) default/async-xxx.js (async-a) 176 bytes <{909}> [rendered] > ./a ./index.js 1:0-47 ./a.js 50 bytes [built] [code generated] ./node_modules/shared.js?1 126 bytes [dependent] [built] [code generated] -chunk (runtime: main) default/async-b.js (async-b) 176 bytes <{909}> [rendered] +chunk (runtime: main) default/async-xxx.js (async-b) 176 bytes <{909}> [rendered] > ./b ./index.js 2:0-47 ./b.js 50 bytes [built] [code generated] ./node_modules/shared.js?1 126 bytes [dependent] [built] [code generated] -chunk (runtime: main) default/async-e.js (async-e) 50 bytes <{909}> ={44}= [rendered] +chunk (runtime: main) default/async-xxx.js (async-e) 50 bytes <{909}> ={44}= [rendered] > ./e ./index.js 5:0-47 ./e.js 50 bytes [built] [code generated] chunk (runtime: main) default/44.js (id hint: vendors) 126 bytes <{909}> ={172}= ={407}= ={602}= [rendered] split chunk (cache group: defaultVendors) @@ -2417,25 +2417,25 @@ chunk (runtime: main) default/44.js (id hint: vendors) 126 bytes <{909}> ={172}= > ./d ./index.js 4:0-47 > ./e ./index.js 5:0-47 ./node_modules/shared.js?2 126 bytes [built] [code generated] -chunk (runtime: main) default/async-d.js (async-d) 50 bytes <{909}> ={44}= [rendered] +chunk (runtime: main) default/async-xxx.js (async-d) 50 bytes <{909}> ={44}= [rendered] > ./d ./index.js 4:0-47 ./d.js 50 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 245 bytes (javascript) 7.39 KiB (runtime) >{172}< >{250}< >{262}< >{407}< >{44}< >{602}< [entry] [rendered] +chunk (runtime: main) default/main.js (main) 245 bytes (javascript) xx KiB (runtime) >{172}< >{250}< >{262}< >{407}< >{44}< >{602}< [entry] [rendered] > ./ main ./index.js 245 bytes [built] [code generated] Rspack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-prefer-bigger-splits 1`] = ` -"Entrypoint main 9.09 KiB = default/main.js -chunk (runtime: main) default/async-c.js (async-c) 70 bytes <{909}> ={457}= [rendered] +"Entrypoint main xx KiB = default/main.js +chunk (runtime: main) default/async-xxx.js (async-c) 70 bytes <{909}> ={457}= [rendered] > ./c ./index.js 3:0-47 ./c.js 70 bytes [built] [code generated] -chunk (runtime: main) default/async-a.js (async-a) 196 bytes <{909}> [rendered] +chunk (runtime: main) default/async-xxx.js (async-a) 196 bytes <{909}> [rendered] > ./a ./index.js 1:0-47 dependent modules 126 bytes [dependent] 2 modules ./a.js 70 bytes [built] [code generated] -chunk (runtime: main) default/async-b.js (async-b) 158 bytes <{909}> ={457}= [rendered] +chunk (runtime: main) default/async-xxx.js (async-b) 158 bytes <{909}> ={457}= [rendered] > ./b ./index.js 2:0-47 dependent modules 63 bytes [dependent] 1 module ./b.js 95 bytes [built] [code generated] @@ -2444,7 +2444,7 @@ chunk (runtime: main) default/457.js (id hint: ) 150 bytes <{909}> ={172}= ={262 > ./c ./index.js 3:0-47 ./d.js 63 bytes [built] [code generated] ./f.js 87 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 7.25 KiB (runtime) >{172}< >{250}< >{262}< >{457}< [entry] [rendered] +chunk (runtime: main) default/main.js (main) 147 bytes (javascript) xx KiB (runtime) >{172}< >{250}< >{262}< >{457}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] [code generated] Rspack x.x.x compiled successfully" @@ -2452,56 +2452,56 @@ Rspack x.x.x compiled successfully" exports[`StatsTestCases should print correct stats for split-chunks-runtime-specific 1`] = ` "used-exports: - asset used-exports-c.js 4.59 KiB [emitted] (name: c) - asset used-exports-b.js 4.59 KiB [emitted] (name: b) - asset used-exports-572.js 353 bytes [emitted] - asset used-exports-a.js 249 bytes [emitted] (name: a) - Entrypoint a 249 bytes = used-exports-a.js - Entrypoint b 4.93 KiB = used-exports-572.js 353 bytes used-exports-b.js 4.59 KiB - Entrypoint c 4.94 KiB = used-exports-572.js 353 bytes used-exports-c.js 4.59 KiB - chunk (runtime: b, c) used-exports-572.js (id hint: ) 72 bytes [initial] [rendered] split chunk (cache group: default) + asset used-xxx.js xx KiB [emitted] (name: c) + asset used-xxx.js xx KiB [emitted] (name: b) + asset used-xxx.js 353 bytes [emitted] + asset used-xxx.js 249 bytes [emitted] (name: a) + Entrypoint a 249 bytes = used-xxx.js + Entrypoint b xx KiB = used-xxx.js xx KiB + Entrypoint c xx KiB = used-xxx.js xx KiB + chunk (runtime: b, c) used-xxx.js (id hint: ) 72 bytes [initial] [rendered] split chunk (cache group: default) ./objects.js 72 bytes [built] [code generated] - chunk (runtime: a) used-exports-a.js (a) 126 bytes [entry] [rendered] + chunk (runtime: a) used-xxx.js (a) 126 bytes [entry] [rendered] ./a.js + 1 modules 126 bytes [code generated] - chunk (runtime: b) used-exports-b.js (b) 54 bytes (javascript) 2.86 KiB (runtime) [entry] [rendered] + chunk (runtime: b) used-xxx.js (b) 54 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 54 bytes [built] [code generated] - chunk (runtime: c) used-exports-c.js (c) 59 bytes (javascript) 2.86 KiB (runtime) [entry] [rendered] + chunk (runtime: c) used-xxx.js (c) 59 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./c.js 59 bytes [built] [code generated] used-exports (Rspack x.x.x) compiled successfully in X.23 no-used-exports: - asset no-used-exports-c.js 4.67 KiB [emitted] (name: c) - asset no-used-exports-b.js 4.66 KiB [emitted] (name: b) - asset no-used-exports-a.js 4.66 KiB [emitted] (name: a) - asset no-used-exports-572.js 501 bytes [emitted] - Entrypoint a 5.15 KiB = no-used-exports-572.js 501 bytes no-used-exports-a.js 4.66 KiB - Entrypoint b 5.15 KiB = no-used-exports-572.js 501 bytes no-used-exports-b.js 4.66 KiB - Entrypoint c 5.16 KiB = no-used-exports-572.js 501 bytes no-used-exports-c.js 4.67 KiB - chunk (runtime: a, b, c) no-used-exports-572.js (id hint: ) 72 bytes [initial] [rendered] split chunk (cache group: default) + asset no-xxx.js xx KiB [emitted] (name: c) + asset no-xxx.js xx KiB [emitted] (name: b) + asset no-xxx.js xx KiB [emitted] (name: a) + asset no-xxx.js 501 bytes [emitted] + Entrypoint a xx KiB = no-xxx.js xx KiB + Entrypoint b xx KiB = no-xxx.js xx KiB + Entrypoint c xx KiB = no-xxx.js xx KiB + chunk (runtime: a, b, c) no-xxx.js (id hint: ) 72 bytes [initial] [rendered] split chunk (cache group: default) ./objects.js 72 bytes [built] [code generated] - chunk (runtime: a) no-used-exports-a.js (a) 54 bytes (javascript) 2.89 KiB (runtime) [entry] [rendered] + chunk (runtime: a) no-xxx.js (a) 54 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./a.js 54 bytes [built] [code generated] - chunk (runtime: b) no-used-exports-b.js (b) 54 bytes (javascript) 2.89 KiB (runtime) [entry] [rendered] + chunk (runtime: b) no-xxx.js (b) 54 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 54 bytes [built] [code generated] - chunk (runtime: c) no-used-exports-c.js (c) 59 bytes (javascript) 2.89 KiB (runtime) [entry] [rendered] + chunk (runtime: c) no-xxx.js (c) 59 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./c.js 59 bytes [built] [code generated] no-used-exports (Rspack x.x.x) compiled successfully in X.23 global: - asset global-c.js 4.59 KiB [emitted] (name: c) - asset global-b.js 4.59 KiB [emitted] (name: b) - asset global-a.js 4.59 KiB [emitted] (name: a) - asset global-572.js 321 bytes [emitted] - Entrypoint a 4.9 KiB = global-572.js 321 bytes global-a.js 4.59 KiB - Entrypoint b 4.9 KiB = global-572.js 321 bytes global-b.js 4.59 KiB - Entrypoint c 4.91 KiB = global-572.js 321 bytes global-c.js 4.59 KiB - chunk (runtime: a, b, c) global-572.js (id hint: ) 72 bytes [initial] [rendered] split chunk (cache group: default) + asset global-xxx.js xx KiB [emitted] (name: c) + asset global-xxx.js xx KiB [emitted] (name: b) + asset global-xxx.js xx KiB [emitted] (name: a) + asset global-xxx.js 321 bytes [emitted] + Entrypoint a xx KiB = global-xxx.js xx KiB + Entrypoint b xx KiB = global-xxx.js xx KiB + Entrypoint c xx KiB = global-xxx.js xx KiB + chunk (runtime: a, b, c) global-xxx.js (id hint: ) 72 bytes [initial] [rendered] split chunk (cache group: default) ./objects.js 72 bytes [built] [code generated] - chunk (runtime: a) global-a.js (a) 54 bytes (javascript) 2.86 KiB (runtime) [entry] [rendered] + chunk (runtime: a) global-xxx.js (a) 54 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./a.js 54 bytes [built] [code generated] - chunk (runtime: b) global-b.js (b) 54 bytes (javascript) 2.86 KiB (runtime) [entry] [rendered] + chunk (runtime: b) global-xxx.js (b) 54 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./b.js 54 bytes [built] [code generated] - chunk (runtime: c) global-c.js (c) 59 bytes (javascript) 2.86 KiB (runtime) [entry] [rendered] + chunk (runtime: c) global-xxx.js (c) 59 bytes (javascript) xx KiB (runtime) [entry] [rendered] ./c.js 59 bytes [built] [code generated] global (Rspack x.x.x) compiled successfully in X.23" `;