diff --git a/crates/rspack_plugin_css/src/utils.rs b/crates/rspack_plugin_css/src/utils.rs index 8811f4ea9b94..0a3cc3d3f1f6 100644 --- a/crates/rspack_plugin_css/src/utils.rs +++ b/crates/rspack_plugin_css/src/utils.rs @@ -26,6 +26,8 @@ use crate::parser_and_generator::{CssExport, CssExportsType}; pub const AUTO_PUBLIC_PATH_PLACEHOLDER: &str = "__RSPACK_PLUGIN_CSS_AUTO_PUBLIC_PATH__"; pub static AUTO_PUBLIC_PATH_PLACEHOLDER_REGEX: Lazy = Lazy::new(|| Regex::new(AUTO_PUBLIC_PATH_PLACEHOLDER).expect("Invalid regexp")); +pub static LEADING_DIGIT_REGEX: Lazy = + Lazy::new(|| Regex::new(r"^\d+").expect("Invalid regexp")); pub struct ModulesTransformConfig<'a> { resource_data: &'a ResourceData, @@ -84,7 +86,9 @@ impl swc_core::css::modules::TransformConfig for ModulesTransformConfig<'_> { hasher.write(local.as_bytes()); } let hash = hasher.digest(self.hash_digest); - hash.rendered(self.hash_digest_length).to_string() + LEADING_DIGIT_REGEX + .replace_all(hash.rendered(self.hash_digest_length), "") + .into_owned() }; let relative_resource = make_paths_relative(self.context.as_str(), &self.resource_data.resource); @@ -110,8 +114,6 @@ impl swc_core::css::modules::TransformConfig for ModulesTransformConfig<'_> { static ESCAPE_LOCAL_IDENT_REGEX: Lazy = Lazy::new(|| Regex::new(r#"[<>:"/\\|?*\.]"#).expect("Invalid regex")); -pub static LEADING_DIGIT_REGEX: Lazy = - Lazy::new(|| Regex::new(r"^\d+").expect("Invalid regexp")); struct LocalIdentNameRenderOptions<'a> { path_data: PathData<'a>, @@ -127,7 +129,7 @@ impl LocalIdentNameRenderOptions<'_> { .always_ok(); s = s.replace("[local]", self.local); s = s.replace("[uniqueName]", self.unique_name); - s = LEADING_DIGIT_REGEX.replace_all(&s, "").into_owned(); + s = ESCAPE_LOCAL_IDENT_REGEX.replace_all(&s, "_").into_owned(); s } diff --git a/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap index a45c95dba2b0..27283e6f2cb6 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap @@ -2,200 +2,200 @@ exports[`config config/builtins/css-auto exported tests css/auto can handle css module correctly 1`] = ` Object { - "style": "-_921b05f8c9c16ca9ea84-style", + "style": "-ca56f23580d7bbb484-style", } `; exports[`config config/builtins/css-modules-composes exported tests css modules composes 1`] = ` Object { - "simple-bar": "-_273d87445e861b3031dc-simple-bar -_9d368fc847854456bea3-imported-simple", - "simple-foo": "-_273d87445e861b3031dc-simple-foo -_9d368fc847854456bea3-imported-simple", + "simple-bar": "-a7200a43b5c2530b1414-simple-bar -f27007fff641a72c371d-imported-simple", + "simple-foo": "-a7200a43b5c2530b1414-simple-foo -f27007fff641a72c371d-imported-simple", } `; exports[`config config/builtins/css-modules-composes-preprocessers exported tests css modules with css preprocessers 1`] = ` Object { - "class": "-_273d87445e861b3031dc-class -_11a6d6ffb863bd538fe5-lessClass", - "ghi": "-_273d87445e861b3031dc-ghi", - "other": "-_273d87445e861b3031dc-other -_1f71e04288dddc43d27d-scssClass", - "otherClassName": "-_273d87445e861b3031dc-otherClassName globalClassName", + "class": "-a7200a43b5c2530b1414-class -feb80f2fe6d30-lessClass", + "ghi": "-a7200a43b5c2530b1414-ghi", + "other": "-a7200a43b5c2530b1414-other -ebd90a48d100efd-scssClass", + "otherClassName": "-a7200a43b5c2530b1414-otherClassName globalClassName", } `; exports[`config config/builtins/css-modules-composes-sass exported tests css modules in scss 1`] = ` Object { - "bar": "-_735885c5e37059075f0c-bar -_3dd446eb32b4cceede74-foo", + "bar": "-f1f00e6e62b9a7fadb02-bar -a3b1929b59eeacf15a4-foo", } `; exports[`config config/builtins/css-modules-dedupe exported tests css modules dedupe 1`] = ` Object { - "backButton": "-d4f5f65e6ec5e3abc2cc-backButton -_0f182db74b24b91ce53c-secondaryButton -ed3ce9538ce4b9c8f8ab-button", - "nextButton": "-d4f5f65e6ec5e3abc2cc-nextButton -_73af08fa9da07d8b8412-primaryButton -ed3ce9538ce4b9c8f8ab-button", + "backButton": "-baa5c4d806a1671b-backButton -b2a7836182365a7a19ae-secondaryButton -f6ca8ebd9e01b-button", + "nextButton": "-baa5c4d806a1671b-nextButton -ffa91d57bfb88e0ca996-primaryButton -f6ca8ebd9e01b-button", } `; exports[`config config/builtins/css-modules-exports-only exported tests css modules exportsOnly 1`] = ` Object { - "simple-bar": "-_273d87445e861b3031dc-simple-bar -_9d368fc847854456bea3-imported-simple", - "simple-foo": "-_273d87445e861b3031dc-simple-foo -_9d368fc847854456bea3-imported-simple", + "simple-bar": "-a7200a43b5c2530b1414-simple-bar -f27007fff641a72c371d-imported-simple", + "simple-foo": "-a7200a43b5c2530b1414-simple-foo -f27007fff641a72c371d-imported-simple", } `; exports[`config config/builtins/css-modules-local-ident-name-hash exported tests css modules localIdentName with hash 1`] = ` Object { - "#": "_2d1f13069a34dadb8112", - "##": "ae8301fd6f3598539bfd", - "#.#.#": "_1c997a569a07f2420708", - "#fake-id": "d3e8bdca9f976f125db0", - "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.": "cf064fddad4f1ee12a13", - "-a-b-c-": "_3009825ac55fd922e1d4", - "-a0-34a___f": "_2470cf17671bc0f04fb9", - ".": "_45953b92c963cd9365ee", - "123": "b83ce8234973aca76caf", - "1a2b3c": "eca4a6468c54eaabda5f", - ":)": "_9cd9dacf371a665c5e39", - ":\`(": "_849c0b45e753bfe7e332", - ":hover": "_0eec8dbaeb3d52c7e318", - ":hover:focus:active": "cebbf8d9d82b804826ba", - "<><<<>><>": "d0504329c86bf6aaf83f", - "

": "_1f3da2d9abca032e8688", - "?": "d53002e1233f2049f1d4", - "@": "_3604bb5089512604fd6d", - "B&W?": "_29a1f492830adeef54f9", - "[attr=value]": "eb2787a6b2019adfdf12", - "_": "e0c21379fbaec4cf8e76", - "_test": "_701db8dd042b793cda43", - "className": "d42832db1967a6f6161f", - "f!o!o": "_1a4bc095be932bd43d82", - "f'o'o": "b419c7cea20ab4e4c57f", - "f*o*o": "bc01ebf6803f206edbdc", - "f+o+o": "a330ce191c89fbe8ef59", - "f/o/o": "a507c95c5be333d80af6", - "f\\\\o\\\\o": "_8ae0554ce544e3013a32", - "foo.bar": "abed3de09fc05d3400f8", - "foo/bar": "_57fbbed34c6039e5045b", - "foo/bar/baz": "_66e03c108771225ae79a", - "foo\\\\bar": "_48beb53984c701be5645", - "foo\\\\bar\\\\baz": "f9e76b11c67b5115ebdb", - "f~o~o": "_451cb3cda3d4bf8ea8f3", - "m_x_@": "_9a7665e6cf83142e1b3c", - "someId": "_9d834034f45a6a2c699b", - "subClass": "fe69f3ebba3ba63e167e", - "test": "b7fc104110738641f152", - "{}": "a7a93ea70d691fba54a2", - "©": "d9e5b239186637532208", - "“‘’”": "_56e0bf6b2fa8a18ff54e", - "⌘⌥": "_6f25eff10f3aecf1d2de", - "☺☃": "c00a0e3463f69bf799ae", - "♥": "_4d9b71f741c330bc24d0", - "𝄞♪♩♫♬": "a01c68c82acee141b0b9", - "💩": "e3663ae314f6186e799a", - "😍": "bfb8a2d9978df6976636", + "#": "b8b048cfa675ca7e9b4f", + "##": "a8e816d5d9b299b2c0d", + "#.#.#": "c6d1911da4c507e78", + "#fake-id": "d71ffe1702e9e5f648a4", + "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.": "f085385047c8494d66a2", + "-a-b-c-": "e171381fc62026ffe05b", + "-a0-34a___f": "e6419db424263d77191e", + ".": "e1742279a9b31ae95d46", + "123": "e3e235fe2ac5b10a03fa", + "1a2b3c": "e510ae3725659c886e", + ":)": "a7752c5da475e25c37", + ":\`(": "ec4ad64c1cd22a195fb2", + ":hover": "aabfd498fc2f10c7", + ":hover:focus:active": "ea9f2b2a3c0d8b6f20f6", + "<><<<>><>": "b9dc5ecfad4841cf835", + "

": "d66e45a3f7eba1bd2ff3", + "?": "db855a2cb1936bcecdd8", + "@": "b7c53c5c915459fb9703", + "B&W?": "b24426e6382e4f90c52", + "[attr=value]": "cebfe9ac1785240b1f84", + "_": "ffc4dae298ad4c338544", + "_test": "acd3c0528ed3c3330", + "className": "a20f38af3e2122251", + "f!o!o": "dfe9da10af7d0818e5e", + "f'o'o": "b91ad92cc62c88a93dc8", + "f*o*o": "c8706122491802a", + "f+o+o": "fb4386a15ebce1ce30f", + "f/o/o": "c6b959b8b545952c7fcf", + "f\\\\o\\\\o": "c9c9fd2189f4eef61", + "foo.bar": "fa92bf8dea4a5a2ea13", + "foo/bar": "e27d59ba2484ded530e7", + "foo/bar/baz": "fb5155c99d0c07a91", + "foo\\\\bar": "c4b0876e6a72fa1da88", + "foo\\\\bar\\\\baz": "d0641bf036f0db5b0fb7", + "f~o~o": "cb1e1a38751d777913bc", + "m_x_@": "acf01e983cc34242b09", + "someId": "f7dad309581ff59a8c1", + "subClass": "f904cf1d95567c868707", + "test": "c8e76de9832d60b206c2", + "{}": "a273624fc967254e4ad3", + "©": "d4c6ea8dbaf492a7e42e", + "“‘’”": "d3df6d853c11234b8", + "⌘⌥": "bbb74fa7684d2b07", + "☺☃": "d09672ed2a23417fa543", + "♥": "f5682d5025ab700972a0", + "𝄞♪♩♫♬": "b7e928b15b6057d2f8", + "💩": "bb34b4e107a01390e3fb", + "😍": "e5439193d7906536aeac", } `; exports[`config config/builtins/css-modules-local-ident-name-path exported tests css modules localIdentName with path 1`] = ` Object { - "#": "src_index__#", - "##": "src_index__##", - "#.#.#": "src_index__#_#_#", - "#fake-id": "src_index__#fake-id", - "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.": "src_index__++++++++++[_+++++++_++++++++++_+++_+____-]_++__+_+++++++__+++__++___+++++++++++++++___+++_------_--------__+___", - "-a-b-c-": "src_index__-a-b-c-", - "-a0-34a___f": "src_index__-a0-34a___f", - ".": "src_index___", - "123": "src_index__123", - "1a2b3c": "src_index__1a2b3c", - ":)": "src_index___)", - ":\`(": "src_index___\`(", - ":hover": "src_index___hover", - ":hover:focus:active": "src_index___hover_focus_active", - "<><<<>><>": "src_index___________", - "

": "src_index___p_", - "?": "src_index___", - "@": "src_index__@", - "B&W?": "src_index__B&W_", - "[attr=value]": "src_index__[attr=value]", - "_": "src_index___", - "_test": "src_index___test", - "className": "src_index__className", - "f!o!o": "src_index__f!o!o", - "f'o'o": "src_index__f'o'o", - "f*o*o": "src_index__f_o_o", - "f+o+o": "src_index__f+o+o", - "f/o/o": "src_index__f_o_o", - "f\\\\o\\\\o": "src_index__f_o_o", - "foo.bar": "src_index__foo_bar", - "foo/bar": "src_index__foo_bar", - "foo/bar/baz": "src_index__foo_bar_baz", - "foo\\\\bar": "src_index__foo_bar", - "foo\\\\bar\\\\baz": "src_index__foo_bar_baz", - "f~o~o": "src_index__f~o~o", - "m_x_@": "src_index__m_x_@", - "someId": "src_index__someId", - "subClass": "src_index__subClass", - "test": "src_index__test", - "{}": "src_index__{}", - "©": "src_index__©", - "“‘’”": "src_index__“‘’”", - "⌘⌥": "src_index__⌘⌥", - "☺☃": "src_index__☺☃", - "♥": "src_index__♥", - "𝄞♪♩♫♬": "src_index__𝄞♪♩♫♬", - "💩": "src_index__💩", - "😍": "src_index__😍", + "#": "__index__#", + "##": "__index__##", + "#.#.#": "__index__#_#_#", + "#fake-id": "__index__#fake-id", + "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.": "__index__++++++++++[_+++++++_++++++++++_+++_+____-]_++__+_+++++++__+++__++___+++++++++++++++___+++_------_--------__+___", + "-a-b-c-": "__index__-a-b-c-", + "-a0-34a___f": "__index__-a0-34a___f", + ".": "__index___", + "123": "__index__123", + "1a2b3c": "__index__1a2b3c", + ":)": "__index___)", + ":\`(": "__index___\`(", + ":hover": "__index___hover", + ":hover:focus:active": "__index___hover_focus_active", + "<><<<>><>": "__index___________", + "

": "__index___p_", + "?": "__index___", + "@": "__index__@", + "B&W?": "__index__B&W_", + "[attr=value]": "__index__[attr=value]", + "_": "__index___", + "_test": "__index___test", + "className": "__index__className", + "f!o!o": "__index__f!o!o", + "f'o'o": "__index__f'o'o", + "f*o*o": "__index__f_o_o", + "f+o+o": "__index__f+o+o", + "f/o/o": "__index__f_o_o", + "f\\\\o\\\\o": "__index__f_o_o", + "foo.bar": "__index__foo_bar", + "foo/bar": "__index__foo_bar", + "foo/bar/baz": "__index__foo_bar_baz", + "foo\\\\bar": "__index__foo_bar", + "foo\\\\bar\\\\baz": "__index__foo_bar_baz", + "f~o~o": "__index__f~o~o", + "m_x_@": "__index__m_x_@", + "someId": "__index__someId", + "subClass": "__index__subClass", + "test": "__index__test", + "{}": "__index__{}", + "©": "__index__©", + "“‘’”": "__index__“‘’”", + "⌘⌥": "__index__⌘⌥", + "☺☃": "__index__☺☃", + "♥": "__index__♥", + "𝄞♪♩♫♬": "__index__𝄞♪♩♫♬", + "💩": "__index__💩", + "😍": "__index__😍", } `; exports[`config config/builtins/css-modules-locals-convention-camelCase exported tests css modules localsConvention with camelCase 1`] = ` Object { - "btn--info_is-disabled_1": "-_273d87445e861b3031dc-btn--info_is-disabled_1", - "btn-info_is-disabled": "-_273d87445e861b3031dc-btn-info_is-disabled", - "btnInfoIsDisabled": "-_273d87445e861b3031dc-btn-info_is-disabled", - "btnInfoIsDisabled1": "-_273d87445e861b3031dc-btn--info_is-disabled_1", - "fooBar": "-_273d87445e861b3031dc-foo_bar", - "foo_bar": "-_273d87445e861b3031dc-foo_bar", - "simple": "-_273d87445e861b3031dc-simple", + "btn--info_is-disabled_1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", + "btn-info_is-disabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", + "btnInfoIsDisabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", + "btnInfoIsDisabled1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", + "fooBar": "-a7200a43b5c2530b1414-foo_bar", + "foo_bar": "-a7200a43b5c2530b1414-foo_bar", + "simple": "-a7200a43b5c2530b1414-simple", } `; exports[`config config/builtins/css-modules-locals-convention-camelCaseOnly exported tests css modules localsConvention with camelCaseOnly 1`] = ` Object { - "btnInfoIsDisabled": "-_273d87445e861b3031dc-btn-info_is-disabled", - "btnInfoIsDisabled1": "-_273d87445e861b3031dc-btn--info_is-disabled_1", - "fooBar": "-_273d87445e861b3031dc-foo_bar", - "simple": "-_273d87445e861b3031dc-simple", + "btnInfoIsDisabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", + "btnInfoIsDisabled1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", + "fooBar": "-a7200a43b5c2530b1414-foo_bar", + "simple": "-a7200a43b5c2530b1414-simple", } `; exports[`config config/builtins/css-modules-locals-convention-dashes exported tests css modules localsConvention with dashes 1`] = ` Object { - "btn--info_is-disabled_1": "-_273d87445e861b3031dc-btn--info_is-disabled_1", - "btn-info-is-disabled": "-_273d87445e861b3031dc-btn-info_is-disabled", - "btn-info-is-disabled-1": "-_273d87445e861b3031dc-btn--info_is-disabled_1", - "btn-info_is-disabled": "-_273d87445e861b3031dc-btn-info_is-disabled", - "foo-bar": "-_273d87445e861b3031dc-foo_bar", - "foo_bar": "-_273d87445e861b3031dc-foo_bar", - "simple": "-_273d87445e861b3031dc-simple", + "btn--info_is-disabled_1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", + "btn-info-is-disabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", + "btn-info-is-disabled-1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", + "btn-info_is-disabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", + "foo-bar": "-a7200a43b5c2530b1414-foo_bar", + "foo_bar": "-a7200a43b5c2530b1414-foo_bar", + "simple": "-a7200a43b5c2530b1414-simple", } `; exports[`config config/builtins/css-modules-pseudo exported tests css modules pseudo syntax 1`] = ` Object { - "bar": "-_273d87445e861b3031dc-bar", - "bav": "-_273d87445e861b3031dc-bav", - "foo": "-_273d87445e861b3031dc-foo", - "four": "-_273d87445e861b3031dc-four", - "one": "-_273d87445e861b3031dc-one", - "three": "-_273d87445e861b3031dc-three", - "two": "-_273d87445e861b3031dc-two", + "bar": "-a7200a43b5c2530b1414-bar", + "bav": "-a7200a43b5c2530b1414-bav", + "foo": "-a7200a43b5c2530b1414-foo", + "four": "-a7200a43b5c2530b1414-four", + "one": "-a7200a43b5c2530b1414-one", + "three": "-a7200a43b5c2530b1414-three", + "two": "-a7200a43b5c2530b1414-two", } `; exports[`config config/builtins/css-modules-simple exported tests css modules simple test 1`] = ` Object { - "style": "-_921b05f8c9c16ca9ea84-style", + "style": "-ca56f23580d7bbb484-style", } `; @@ -245,17 +245,17 @@ exports[`config config/css/export-selector exported tests should have correct cs " `; -exports[`config config/css/rewrite-url exported tests should rewrite the css url() 1`] = `"eb587e4780c414fe3a22.png"`; +exports[`config config/css/rewrite-url exported tests should rewrite the css url() 1`] = `"95988e500e4d2ddfeeb7.png"`; exports[`config config/css/rewrite-url exported tests should rewrite the css url() 2`] = `"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAYAAAAbvf3sAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEWSURBVHgBjZFRSsNAEIb/3fQAOUK9gfpe6YIovjU3UE+gJ2g8gTcw3sC+itUFrW+BeAN7ATFSKAjbHWcSC+mSlszLDrvfzvzzj0LHmNpZBtBQd4Gf7fuYgHPPueoCe1DK1UsHd7Dzw+P0daQj/SC5h09OzdGktw221vZXUBlVMN0ILPd6O9yzBBXX8CBdv6kWOGa4YLivQJNjM0ia73oTLsBwJjCB5gu4i7CgbsIey5ThEcOfKziTGFOGHypJeZ7jZ/Gbst4x2/fN9h2eGTNvgk92VrDEWLNmfJXLpIYrRy5b4Fs+9v2/pL0oUncI7FuHLI6PK5lJZGoe8qXNvrry27DesoRLpLPmNkTw9yEcxPWJMR+S/AFbfpAZqxwUNQAAAABJRU5ErkJggg=="`; -exports[`config config/css/rewrite-url-css-variables exported tests should rewrite the css url() in css variables 1`] = `"eb587e4780c414fe3a22.png"`; +exports[`config config/css/rewrite-url-css-variables exported tests should rewrite the css url() in css variables 1`] = `"95988e500e4d2ddfeeb7.png"`; -exports[`config config/css/rewrite-url-css-variables exported tests should rewrite the css url() in css variables 2`] = `"eb587e4780c414fe3a22.png"`; +exports[`config config/css/rewrite-url-css-variables exported tests should rewrite the css url() in css variables 2`] = `"95988e500e4d2ddfeeb7.png"`; -exports[`config config/css/rewrite-url-with-css-filename exported tests should rewrite the css url() with publicPath and ~@ prefix 1`] = `"/image/logo.eb587e47.png"`; +exports[`config config/css/rewrite-url-with-css-filename exported tests should rewrite the css url() with publicPath and ~@ prefix 1`] = `"/image/logo.95988e50.png"`; -exports[`config config/css/rewrite-url-with-css-filename exported tests should rewrite the css url() with publicPath when output.cssFilename is set 1`] = `"/image/logo.eb587e47.png"`; +exports[`config config/css/rewrite-url-with-css-filename exported tests should rewrite the css url() with publicPath when output.cssFilename is set 1`] = `"/image/logo.95988e50.png"`; exports[`config config/css/urls exported tests css urls should works 1`] = ` "/* @supports (background-image: url(\\"unknown.png\\")) { @@ -302,7 +302,7 @@ div { div { a1: url(); - a114: url(ebb93b9cb62e55bcbc35.png); + a114: url(4d3b8fdfbe46b279f223.png); } div { @@ -387,10 +387,10 @@ exports[`config config/schemes/data-imports exported tests data imports 1`] = ` .class { - a: url(bd595024fc7e226eea64.svg); - b: url(bd595024fc7e226eea64.svg); - c: url(bd595024fc7e226eea64); - d: url(bd595024fc7e226eea64); + a: url(3a4d6b1f7ae9358a676b.svg); + b: url(3a4d6b1f7ae9358a676b.svg); + c: url(3a4d6b1f7ae9358a676b); + d: url(3a4d6b1f7ae9358a676b); } " diff --git a/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap index 6f3f4683518b..142957a81c45 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap @@ -102,7 +102,7 @@ Object { "errors": Array [], "errorsCount": 0, "filteredModules": undefined, - "hash": "57e46af248a1c1fe076f", + "hash": "ee9a5ee8da42dac2c2aa", "logging": Object {}, "modules": Array [ Object { @@ -402,7 +402,7 @@ Object { "errors": Array [], "errorsCount": 0, "filteredModules": undefined, - "hash": "4b5e3314a79376e83a18", + "hash": "36dd148024fa89ee453a", "logging": Object {}, "modules": Array [ Object { @@ -968,7 +968,7 @@ exports.c = require(\\"./c?c=3\\"); "errors": Array [], "errorsCount": 0, "filteredModules": undefined, - "hash": "aa85e38b2dc3e3f7dbda", + "hash": "4fed4a0fec64e42d02f8", "logging": Object {}, "modules": Array [ Object { 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 f7aefb1c36a8..97114eeefb4a 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap @@ -2,8 +2,8 @@ exports[`statsOutput statsOutput/auxiliary-files-test should print correct stats for auxiliary-files-test 1`] = ` "PublicPath: auto +asset a09d8e0f399c215faa79.png 7 bytes {909} [emitted] [from: raw.png] (name: main) asset bundle.js 2.4 KiB {909} [emitted] (name: main) -asset f7f4f00355f310234f70.png 7 bytes {909} [emitted] [from: raw.png] (name: main) Entrypoint main 2.4 KiB = bundle.js chunk {909} bundle.js (main) [entry] ./raw.png [193] {909} @@ -33,7 +33,7 @@ webpack/runtime/auto_public_path {909} [no exports] [used exports unknown] -Rspack compiled successfully (ad3050f7790e51415050)" +Rspack compiled successfully (96c9a0233f5bdeaa93e8)" `; exports[`statsOutput statsOutput/builtin-swc-loader-parse-error should print correct stats for builtin-swc-loader-parse-error 1`] = ` @@ -60,7 +60,7 @@ Entrypoint main 654 bytes = main.js ERROR in × Resolve error: Can't resolve './src' in 'Xdir/css-concat-error' -Rspack x.x.x compiled with 1 error in X s (6a173f34164e1af948e4)" +Rspack x.x.x compiled with 1 error in X s (8808376bbd25437de260)" `; exports[`statsOutput statsOutput/filename should print correct stats for filename 1`] = ` @@ -71,7 +71,7 @@ Entrypoint main 8.73 KiB = 909.xxxx.js runtime modules 11 modules ./index.js ./dynamic.js -Rspack x.x.x compiled successfully in X s (185b80456c181897fcd5)" +Rspack x.x.x compiled successfully in X s (a41322d0088be2cf18dc)" `; exports[`statsOutput statsOutput/hot+production should print correct stats for hot+production 1`] = ` @@ -80,7 +80,7 @@ asset main.js 32.1 KiB [emitted] (name: main) Entrypoint main 32.1 KiB = main.js runtime modules 11 modules ./index.js -Rspack x.x.x compiled successfully in X s (db903683225d0fe50e7b)" +Rspack x.x.x compiled successfully in X s (bda0662c38188eca4d63)" `; exports[`statsOutput statsOutput/ignore-plugin should print correct stats for ignore-plugin 1`] = ` @@ -133,7 +133,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s ./d.js ./e.js ./index.js - 1 chunks (Rspack x.x.x) compiled successfully in X s (0d76b7dadd0c657ad341) + 1 chunks (Rspack x.x.x) compiled successfully in X s (9343a795eebf86cac89a) 2 chunks: PublicPath: auto @@ -147,7 +147,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s chunk bundle2.js (main) >{76}< [entry] ./b.js ./index.js - 2 chunks (Rspack x.x.x) compiled successfully in X s (a80080d4a166d3a145b2) + 2 chunks (Rspack x.x.x) compiled successfully in X s (58d446010942300c8786) 3 chunks: PublicPath: auto @@ -163,7 +163,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s chunk bundle3.js (main) >{76}< [entry] ./b.js ./index.js - 3 chunks (Rspack x.x.x) compiled successfully in X s (0e854af4043d4cced12b) + 3 chunks (Rspack x.x.x) compiled successfully in X s (e1f702c28a1f7745f19e) 4 chunks: PublicPath: auto @@ -181,7 +181,7 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s chunk bundle4.js (main) >{76}< [entry] ./b.js ./index.js - 4 chunks (Rspack x.x.x) compiled successfully in X s (4525b2f4f1626b91a6f4)" + 4 chunks (Rspack x.x.x) compiled successfully in X s (799760b5db8d720723c3)" `; exports[`statsOutput statsOutput/logging-loader should print correct stats for logging-loader 1`] = ` @@ -311,7 +311,7 @@ ERROR in ./index.js ╰──── help: maybe it had cyclic aliases -Rspack x.x.x compiled with 1 error in X s (59974c3941ac297dceb3)" +Rspack x.x.x compiled with 1 error in X s (1610bb37730c587998bd)" `; exports[`statsOutput statsOutput/resolve-unexpected-exports-in-pkg-error should print correct stats for resolve-unexpected-exports-in-pkg-error 1`] = ` @@ -324,7 +324,7 @@ runtime modules 1 module ERROR in ./index.js × Invalid \\"exports\\" target \\"../../index.js\\" defined for '.' in the package config Xdir/resolve-unexpected-exports-in-pkg-error/node_modules/pkg-a/package.json -Rspack x.x.x compiled with 1 error in X s (c1888f6bacf659a49dc3)" +Rspack x.x.x compiled with 1 error in X s (b45f1a2adf9c9eae762e)" `; exports[`statsOutput statsOutput/runtime-modules should print correct stats for runtime-modules 1`] = ` @@ -347,7 +347,7 @@ Entrypoint main 1.66 KiB = main.js ./increment.js [exports: decrement, increment, incrementBy2] [only some exports used: increment] -Rspack x.x.x compiled successfully in X s (962310b17150e819242d)" +Rspack x.x.x compiled successfully in X s (9efe9f85d71294bf4e5f)" `; exports[`statsOutput statsOutput/side-effects-bailouts should print correct stats for side-effects-bailouts 1`] = ` @@ -382,7 +382,7 @@ webpack/runtime/define_property_getters {909} [no exports] [used exports unknown] -1970-04-20 12:42:42: Rspack x.x.x compiled successfully in X s (6407ed847eb679304311)" +1970-04-20 12:42:42: Rspack x.x.x compiled successfully in X s (c4f7bcbb8ec6a06a4661)" `; exports[`statsOutput statsOutput/simple-export should print correct stats for simple-export 1`] = ` @@ -391,7 +391,7 @@ asset bundle.js 1.79 KiB [emitted] (name: main) Entrypoint main 1.79 KiB = bundle.js runtime modules 3 modules ./index.js -Rspack x.x.x compiled successfully in X s (28af2d7a47e4039ec00e)" +Rspack x.x.x compiled successfully in X s (a3d8bfb29f0f2ccec405)" `; exports[`statsOutput statsOutput/simple-module-source should print correct stats for simple-module-source 1`] = ` @@ -402,7 +402,7 @@ runtime modules 3 modules orphan modules [orphan] 1 module ./raw.png ./index.js -Rspack compiled successfully (de1220b5052bdbe79250)" +Rspack compiled successfully (d0ce130488abf5f87f64)" `; exports[`statsOutput statsOutput/stats-hooks should print correct stats for stats-hooks 1`] = ` @@ -410,7 +410,7 @@ exports[`statsOutput statsOutput/stats-hooks should print correct stats for stat asset main.js 764 bytes [emitted111] (name: main) [testA: aaaaaa] Entrypoint main 764 bytes = main.js ./index.js -Rspack compiled successfully (baea1f1033101ca9fde6)" +Rspack compiled successfully (d55a67420c97eab0f0a6)" `; exports[`statsOutput statsOutput/try-require-module should print correct stats for try-require-module 1`] = ` diff --git a/packages/rspack-test-tools/tests/builtinCases/plugin-asset/asset-simple/snapshot/output.snap.txt b/packages/rspack-test-tools/tests/builtinCases/plugin-asset/asset-simple/snapshot/output.snap.txt index 078cd8d499f2..6d3d378e46aa 100644 --- a/packages/rspack-test-tools/tests/builtinCases/plugin-asset/asset-simple/snapshot/output.snap.txt +++ b/packages/rspack-test-tools/tests/builtinCases/plugin-asset/asset-simple/snapshot/output.snap.txt @@ -40,7 +40,7 @@ function createImageElement(title, src) { module.exports = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQ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eP+uaAoGR7Mn1J9VrJgwDSeZnmXoK4+UJEQOgOFNFBogP7vi7qHcMPZ39X/AeT/8AC3n0aVU6vHwqL4fn9vP3/wBmoEym/Mf2VpwMCfqL4nGq0dIwkcwHwQfbVVgYgjwAENnija4S/wAd9hno3EFqSnRxWvkFceg6P+pCDHIfl38NkO0JMIMAyc//ABRJI6eX04f5rq7Ob/fx9/8A4IuG90n25KwuDgg+SeLJ4Dhz4j/8Ea5dhw/w1sK3kaH9/wBH/wCQAgIkI6JYpuefL/Hi+DYLvwPD/wAeG/rfx/6SxnuZ+PP1cwLpwfTr+f8A8zmogElyHcy7/h5vL8QIS/rfxvnIEcfJ4LEpzQ4fNAgAEAEAf/nwpQ4M+BKhz0GHol990aI4CD/9M//Z";}), "./images/file.png": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; -module.exports = __webpack_require__.p + "7baf20ff2eb011d3.png";}), +module.exports = __webpack_require__.p + "cee6b2eecb9ff70a.png";}), "./images/file.svg": (function (module) { "use strict"; module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MDAgNjAwIj48dGl0bGU+aWNvbi1zcXVhcmUtc21hbGw8L3RpdGxlPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0zMDAgLjFMNTY1IDE1MHYyOTkuOUwzMDAgNTk5LjggMzUgNDQ5LjlWMTUweiIvPjxwYXRoIGZpbGw9IiM4RUQ2RkIiIGQ9Ik01MTcuNyA0MzkuNUwzMDguOCA1NTcuOHYtOTJMNDM5IDM5NC4xbDc4LjcgNDUuNHptMTQuMy0xMi45VjE3OS40bC03Ni40IDQ0LjF2MTU5bDc2LjQgNDQuMXpNODEuNSA0MzkuNWwyMDguOSAxMTguMnYtOTJsLTEzMC4yLTcxLjYtNzguNyA0NS40em0tMTQuMy0xMi45VjE3OS40bDc2LjQgNDQuMXYxNTlsLTc2LjQgNDQuMXptOC45LTI2My4yTDI5MC40IDQyLjJ2ODlsLTEzNy4zIDc1LjUtMS4xLjYtNzUuOS00My45em00NDYuOSAwTDMwOC44IDQyLjJ2ODlMNDQ2IDIwNi44bDEuMS42IDc1LjktNDR6Ii8+PHBhdGggZmlsbD0iIzFDNzhDMCIgZD0iTTI5MC40IDQ0NC44TDE2MiAzNzQuMVYyMzQuMmwxMjguNCA3NC4xdjEzNi41em0xOC40IDBsMTI4LjQtNzAuNnYtMTQwbC0xMjguNCA3NC4xdjEzNi41ek0yOTkuNiAzMDN6bS0xMjktODVsMTI5LTcwLjlMNDI4LjUgMjE4bC0xMjguOSA3NC40LTEyOS03NC40eiIvPjwvc3ZnPgo=";}), diff --git a/packages/rspack-test-tools/tests/builtinCases/plugin-css-modules/modules-composes/snapshot/output.snap.txt b/packages/rspack-test-tools/tests/builtinCases/plugin-css-modules/modules-composes/snapshot/output.snap.txt index e165812b4398..55dd6c2480c1 100644 --- a/packages/rspack-test-tools/tests/builtinCases/plugin-css-modules/modules-composes/snapshot/output.snap.txt +++ b/packages/rspack-test-tools/tests/builtinCases/plugin-css-modules/modules-composes/snapshot/output.snap.txt @@ -1,23 +1,23 @@ ```css title=main.css -._f_module__f-1--____33039942d115f59c__33 { +.___f_module____f-1--___af10a85c64a6b515_af1 { color: black; } -._f_module__f--____33039942d115f59c__33 {} -._d_module__d-1--____3adea2b80c7f9bb9__3a { +.___f_module____f--___af10a85c64a6b515_af1 {} +.___d_module____d-1--___a41e34edaa1ca3c_a41 { color: green; } -._d_module__d--____3adea2b80c7f9bb9__3a {} -._b_module__b-1--____42eb20d659c9bbbb__42 { +.___d_module____d--___a41e34edaa1ca3c_a41 {} +.___b_module____b-1--___eca6dd2253f6b569_eca { color: red; } -._b_module__b--____42eb20d659c9bbbb__42 {} -._style_module__chain2--____7dc7309cdb55212a__7d { +.___b_module____b--___eca6dd2253f6b569_eca {} +.___style_module____chain2--___afc435275e612570_afc { background: blue; } -._style_module__chain1--____7dc7309cdb55212a__7d { +.___style_module____chain1--___afc435275e612570_afc { background: green; } -._style_module__root-class--____7dc7309cdb55212a__7d { +.___style_module____root-class--___afc435275e612570_afc { background: red; } @@ -34,30 +34,30 @@ __webpack_require__.r(__webpack_exports__); "./b.module.css": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; __webpack_require__.r(module.exports = { - "b": "_b_module__b--____42eb20d659c9bbbb__42" + " " + "_b_module__b-1--____42eb20d659c9bbbb__42", - "b-1": "_b_module__b-1--____42eb20d659c9bbbb__42", + "b": "___b_module____b--___eca6dd2253f6b569_eca" + " " + "___b_module____b-1--___eca6dd2253f6b569_eca", + "b-1": "___b_module____b-1--___eca6dd2253f6b569_eca", }); }), "./d.module.css": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; __webpack_require__.r(module.exports = { - "d": "_d_module__d--____3adea2b80c7f9bb9__3a" + " " + "_d_module__d-1--____3adea2b80c7f9bb9__3a", - "d-1": "_d_module__d-1--____3adea2b80c7f9bb9__3a", + "d": "___d_module____d--___a41e34edaa1ca3c_a41" + " " + "___d_module____d-1--___a41e34edaa1ca3c_a41", + "d-1": "___d_module____d-1--___a41e34edaa1ca3c_a41", }); }), "./f.module.css": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; __webpack_require__.r(module.exports = { - "f": "_f_module__f--____33039942d115f59c__33" + " " + "_f_module__f-1--____33039942d115f59c__33", - "f-1": "_f_module__f-1--____33039942d115f59c__33", + "f": "___f_module____f--___af10a85c64a6b515_af1" + " " + "___f_module____f-1--___af10a85c64a6b515_af1", + "f-1": "___f_module____f-1--___af10a85c64a6b515_af1", }); }), "./style.module.css": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; __webpack_require__.r(module.exports = { - "chain1": "_style_module__chain1--____7dc7309cdb55212a__7d" + " " + "_style_module__chain2--____7dc7309cdb55212a__7d" + " " + "c" + " " + __webpack_require__("./d.module.css")["d"] + " " + "e" + " " + __webpack_require__("./f.module.css")["f"], - "chain2": "_style_module__chain2--____7dc7309cdb55212a__7d" + " " + "e" + " " + __webpack_require__("./f.module.css")["f"], - "root-class": "_style_module__root-class--____7dc7309cdb55212a__7d" + " " + "_style_module__chain1--____7dc7309cdb55212a__7d" + " " + "a" + " " + __webpack_require__("./b.module.css")["b"] + " " + "_style_module__chain2--____7dc7309cdb55212a__7d" + " " + "c" + " " + __webpack_require__("./d.module.css")["d"] + " " + "e" + " " + __webpack_require__("./f.module.css")["f"], + "chain1": "___style_module____chain1--___afc435275e612570_afc" + " " + "___style_module____chain2--___afc435275e612570_afc" + " " + "c" + " " + __webpack_require__("./d.module.css")["d"] + " " + "e" + " " + __webpack_require__("./f.module.css")["f"], + "chain2": "___style_module____chain2--___afc435275e612570_afc" + " " + "e" + " " + __webpack_require__("./f.module.css")["f"], + "root-class": "___style_module____root-class--___afc435275e612570_afc" + " " + "___style_module____chain1--___afc435275e612570_afc" + " " + "a" + " " + __webpack_require__("./b.module.css")["b"] + " " + "___style_module____chain2--___afc435275e612570_afc" + " " + "c" + " " + __webpack_require__("./d.module.css")["d"] + " " + "e" + " " + __webpack_require__("./f.module.css")["f"], }); }), diff --git a/packages/rspack-test-tools/tests/builtinCases/plugin-css-modules/modules-ident-name/snapshot/output.snap.txt b/packages/rspack-test-tools/tests/builtinCases/plugin-css-modules/modules-ident-name/snapshot/output.snap.txt index 7801d3245c32..b038d1133eaa 100644 --- a/packages/rspack-test-tools/tests/builtinCases/plugin-css-modules/modules-ident-name/snapshot/output.snap.txt +++ b/packages/rspack-test-tools/tests/builtinCases/plugin-css-modules/modules-ident-name/snapshot/output.snap.txt @@ -1,5 +1,5 @@ ```css title=main.css -._style_module__foo--____7dc7309cdb55212a__7d { +.___style_module____foo--___afc435275e612570_afc { color: hotpink; } @@ -17,7 +17,7 @@ console.log(_style_module_css__WEBPACK_IMPORTED_MODULE_0__); "./style.module.css": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; __webpack_require__.r(module.exports = { - "foo": "_style_module__foo--____7dc7309cdb55212a__7d", + "foo": "___style_module____foo--___afc435275e612570_afc", }); }), diff --git a/packages/rspack-test-tools/tests/builtinCases/plugin-html/filename/snapshot/output.snap.txt b/packages/rspack-test-tools/tests/builtinCases/plugin-html/filename/snapshot/output.snap.txt index 3768c4159d73..b38fe8fc5b72 100644 --- a/packages/rspack-test-tools/tests/builtinCases/plugin-html/filename/snapshot/output.snap.txt +++ b/packages/rspack-test-tools/tests/builtinCases/plugin-html/filename/snapshot/output.snap.txt @@ -1,4 +1,4 @@ -```html title=default.248cbd4291badac0.html +```html title=default.ef8306b113a7b5d7.html @@ -10,7 +10,7 @@ ``` -```html title=index.248cbd4291badac0.html +```html title=index.ef8306b113a7b5d7.html diff --git a/packages/rspack-test-tools/tests/builtinCases/plugin-javascript/new-url-source/snapshot/output.snap.txt b/packages/rspack-test-tools/tests/builtinCases/plugin-javascript/new-url-source/snapshot/output.snap.txt index e5ec389d2555..1568a39ffe67 100644 --- a/packages/rspack-test-tools/tests/builtinCases/plugin-javascript/new-url-source/snapshot/output.snap.txt +++ b/packages/rspack-test-tools/tests/builtinCases/plugin-javascript/new-url-source/snapshot/output.snap.txt @@ -9,10 +9,10 @@ img.src = imgSrc2; }), "./react.svg": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; -module.exports = __webpack_require__.p + "ef0c5aab88bb335e.svg";}), +module.exports = __webpack_require__.p + "ef805cb3080d4db4.svg";}), "./vue.svg": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; -module.exports = __webpack_require__.p + "7908863e290b1fc6.svg";}), +module.exports = __webpack_require__.p + "adc3645d19cb2dbe.svg";}), },function(__webpack_require__) { var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) } diff --git a/packages/rspack-test-tools/tests/builtinCases/plugin-wasm/imports-multiple/snapshot/output.snap.txt b/packages/rspack-test-tools/tests/builtinCases/plugin-wasm/imports-multiple/snapshot/output.snap.txt index 80391e585b9d..dd02754f2da6 100644 --- a/packages/rspack-test-tools/tests/builtinCases/plugin-wasm/imports-multiple/snapshot/output.snap.txt +++ b/packages/rspack-test-tools/tests/builtinCases/plugin-wasm/imports-multiple/snapshot/output.snap.txt @@ -55,7 +55,7 @@ __webpack_async_result__(); "./wasm.wasm": (function (module, exports, __webpack_require__) { "use strict"; var __webpack_instantiate__ = function ([WEBPACK_IMPORTED_MODULE_0, WEBPACK_IMPORTED_MODULE_1]) { -return __webpack_require__.v(exports, module.id, "7ff106a99b84c158" , { +return __webpack_require__.v(exports, module.id, "99f401a36b8fee81" , { "./module": { "getNumber": WEBPACK_IMPORTED_MODULE_0["getNumber"] }, @@ -71,7 +71,7 @@ var WEBPACK_IMPORTED_MODULE_1 = __webpack_require__("./module2.js"); var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([WEBPACK_IMPORTED_MODULE_0, WEBPACK_IMPORTED_MODULE_1]); var [WEBPACK_IMPORTED_MODULE_0, WEBPACK_IMPORTED_MODULE_1] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__; - await __webpack_require__.v(exports, module.id, "7ff106a99b84c158" , { + await __webpack_require__.v(exports, module.id, "99f401a36b8fee81" , { "./module": { "getNumber": WEBPACK_IMPORTED_MODULE_0["getNumber"] }, diff --git a/packages/rspack-test-tools/tests/builtinCases/plugin-wasm/v128/snapshot/output.snap.txt b/packages/rspack-test-tools/tests/builtinCases/plugin-wasm/v128/snapshot/output.snap.txt index af4a0c1edcea..e73655adfb58 100644 --- a/packages/rspack-test-tools/tests/builtinCases/plugin-wasm/v128/snapshot/output.snap.txt +++ b/packages/rspack-test-tools/tests/builtinCases/plugin-wasm/v128/snapshot/output.snap.txt @@ -13,7 +13,7 @@ __webpack_async_result__(); } catch(e) { __webpack_async_result__(e); } });}), "./v128.wasm": (function (module, exports, __webpack_require__) { "use strict"; - module.exports = __webpack_require__.v(exports, module.id, "1a19b30af21700aa" );}), + module.exports = __webpack_require__.v(exports, module.id, "83b6564dd2e8778e" );}), },function(__webpack_require__) { var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) } diff --git a/packages/rspack-test-tools/tests/configCases/concatenate-modules/with-css/index.js b/packages/rspack-test-tools/tests/configCases/concatenate-modules/with-css/index.js index 55e36ab9f262..44d2c13b0f01 100644 --- a/packages/rspack-test-tools/tests/configCases/concatenate-modules/with-css/index.js +++ b/packages/rspack-test-tools/tests/configCases/concatenate-modules/with-css/index.js @@ -4,7 +4,7 @@ test; it("should concatenate css", () => { expect(styles).toMatchObject({ - foo: "foo_css__foo", - test: "foo_css__test" + foo: "__foo_css__foo", + test: "__foo_css__test" }); }); diff --git a/packages/rspack-test-tools/tests/configCases/mangle-exports/skipping-mangle-css-modules/index.js b/packages/rspack-test-tools/tests/configCases/mangle-exports/skipping-mangle-css-modules/index.js index fbbd4af5affd..a6d2a8a9f7d8 100644 --- a/packages/rspack-test-tools/tests/configCases/mangle-exports/skipping-mangle-css-modules/index.js +++ b/packages/rspack-test-tools/tests/configCases/mangle-exports/skipping-mangle-css-modules/index.js @@ -1,11 +1,10 @@ import test from "./index.module.css"; import { res } from "./lib.js"; - it("should not mangle css module", () => { res; // Using this to trigger a none provided export test.res; - expect(test.test).toBe("-_921b05f8c9c16ca9ea84-test"); + expect(test.test).toBe("-ca56f23580d7bbb484-test"); }); diff --git a/packages/rspack-test-tools/tests/hotCases/chunk/asset/snapshot/web/2.snap.txt b/packages/rspack-test-tools/tests/hotCases/chunk/asset/snapshot/web/2.snap.txt index ce5e15ff5f83..a9b35f40ec2c 100644 --- a/packages/rspack-test-tools/tests/hotCases/chunk/asset/snapshot/web/2.snap.txt +++ b/packages/rspack-test-tools/tests/hotCases/chunk/asset/snapshot/web/2.snap.txt @@ -38,7 +38,7 @@ module.exports = 3; }), "./raw.png": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; -module.exports = __webpack_require__.p + "f7f4f00355f310234f70.png";}), +module.exports = __webpack_require__.p + "a09d8e0f399c215faa79.png";}), },function(__webpack_require__) { // webpack/runtime/get_full_hash diff --git a/packages/rspack-test-tools/tests/hotCases/css/parser-and-generator-states/index.js b/packages/rspack-test-tools/tests/hotCases/css/parser-and-generator-states/index.js index 840ed57f0da4..f3a2a8bb9eca 100644 --- a/packages/rspack-test-tools/tests/hotCases/css/parser-and-generator-states/index.js +++ b/packages/rspack-test-tools/tests/hotCases/css/parser-and-generator-states/index.js @@ -1,9 +1,9 @@ import style from './index.module.css'; it("should store and resume css parser and generator states", (done) => { - expect(style['btnInfoIsDisabled']).toBe('index_module_css__btn-info_is-disabled'); + expect(style['btnInfoIsDisabled']).toBe('__index_module_css__btn-info_is-disabled'); module.hot.accept("./index.module.css", () => { - expect(style['btnInfoIsDisabled']).toBe('index_module_css__btn-info_is-disabled'); + expect(style['btnInfoIsDisabled']).toBe('__index_module_css__btn-info_is-disabled'); done(); }); NEXT(require("../../update")(done)); diff --git a/packages/rspack-test-tools/tests/hotCases/css/parser-and-generator-states/snapshot/web/1.snap.txt b/packages/rspack-test-tools/tests/hotCases/css/parser-and-generator-states/snapshot/web/1.snap.txt index 2d369a03756c..0bd69a4c7e7f 100644 --- a/packages/rspack-test-tools/tests/hotCases/css/parser-and-generator-states/snapshot/web/1.snap.txt +++ b/packages/rspack-test-tools/tests/hotCases/css/parser-and-generator-states/snapshot/web/1.snap.txt @@ -6,7 +6,7 @@ ## Asset Files - Bundle: bundle.js - Manifest: main.LAST_HASH.hot-update.json, size: 28 -- Update: main.LAST_HASH.hot-update.js, size: 487 +- Update: main.LAST_HASH.hot-update.js, size: 491 ## Manifest @@ -34,8 +34,8 @@ self["webpackHotUpdate"]('main', { "./index.module.css": (function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; __webpack_require__.r(module.exports = { - "btn-info_is-disabled": "index_module_css__btn-info_is-disabled", - "btnInfoIsDisabled": "index_module_css__btn-info_is-disabled", + "btn-info_is-disabled": "__index_module_css__btn-info_is-disabled", + "btnInfoIsDisabled": "__index_module_css__btn-info_is-disabled", }); }), diff --git a/packages/rspack-test-tools/tests/statsAPICases/basic.js b/packages/rspack-test-tools/tests/statsAPICases/basic.js index 0dcc23730059..7baa730c6c8c 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/basic.js +++ b/packages/rspack-test-tools/tests/statsAPICases/basic.js @@ -34,7 +34,7 @@ module.exports = { Statement with side_effects in source code at ./fixtures/a.js:1:0-3:2 entry ./fixtures/a - Rspack compiled successfully (57e46af248a1c1fe076f)" + Rspack compiled successfully (ee9a5ee8da42dac2c2aa)" `); } }; diff --git a/packages/rspack-test-tools/tests/statsAPICases/exports.js b/packages/rspack-test-tools/tests/statsAPICases/exports.js index 253d5c1e7657..a2a14e75b794 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/exports.js +++ b/packages/rspack-test-tools/tests/statsAPICases/exports.js @@ -44,7 +44,7 @@ module.exports = { ./fixtures/esm/abc.js [no exports] [no exports used] - Rspack compiled successfully (4b5e3314a79376e83a18)" + Rspack compiled successfully (36dd148024fa89ee453a)" `); } }; diff --git a/packages/rspack-test-tools/tests/statsAPICases/to-string.js b/packages/rspack-test-tools/tests/statsAPICases/to-string.js index a24991a0fe3d..eb0efed65fa9 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/to-string.js +++ b/packages/rspack-test-tools/tests/statsAPICases/to-string.js @@ -31,7 +31,7 @@ module.exports = { help: You may need an appropriate loader to handle this file type. - Rspack compiled with 1 error (3fa2fc6e23dccdd9a108)" + Rspack compiled with 1 error (2269ff26c17a6bb04d0e)" `); } };