From 58b48b8e9b97f624c61dbcaea414fbfaee690d37 Mon Sep 17 00:00:00 2001 From: Fy <1114550440@qq.com> Date: Mon, 12 Aug 2024 16:10:09 +0800 Subject: [PATCH] fix: chunk hash unstable (#7534) --- crates/rspack_plugin_runtime/src/helpers.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/rspack_plugin_runtime/src/helpers.rs b/crates/rspack_plugin_runtime/src/helpers.rs index 08981f967a0c..c221d5b9016d 100644 --- a/crates/rspack_plugin_runtime/src/helpers.rs +++ b/crates/rspack_plugin_runtime/src/helpers.rs @@ -1,6 +1,6 @@ use std::hash::Hash; -use rspack_collections::{IdentifierLinkedMap, UkeySet}; +use rspack_collections::{IdentifierLinkedMap, UkeyIndexSet}; use rspack_core::{ get_chunk_from_ukey, get_chunk_group_from_ukey, get_js_chunk_filename_template, rspack_sources::{BoxSource, RawSource, SourceExt}, @@ -53,14 +53,14 @@ pub fn get_all_chunks( exclude_chunk1: &ChunkUkey, exclude_chunk2: Option<&ChunkUkey>, chunk_group_by_ukey: &ChunkGroupByUkey, -) -> UkeySet { +) -> UkeyIndexSet { fn add_chunks( chunk_group_by_ukey: &ChunkGroupByUkey, - chunks: &mut UkeySet, + chunks: &mut UkeyIndexSet, entrypoint_ukey: &ChunkGroupUkey, exclude_chunk1: &ChunkUkey, exclude_chunk2: Option<&ChunkUkey>, - visit_chunk_groups: &mut UkeySet, + visit_chunk_groups: &mut UkeyIndexSet, ) { if let Some(entrypoint) = get_chunk_group_from_ukey(entrypoint_ukey, chunk_group_by_ukey) { for chunk in &entrypoint.chunks { @@ -96,8 +96,8 @@ pub fn get_all_chunks( } } - let mut chunks: UkeySet = UkeySet::default(); - let mut visit_chunk_groups = UkeySet::default(); + let mut chunks = UkeyIndexSet::default(); + let mut visit_chunk_groups = UkeyIndexSet::default(); add_chunks( chunk_group_by_ukey,