Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hyf0 committed May 4, 2023
1 parent b458cdb commit 5eff55d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/rspack_plugin_split_chunks_new/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ impl SplitChunksPlugin {
/// If the current chunk contains modules already split out from the main bundle,
/// it will be reused instead of a new one being generated. This can affect the
/// resulting file name of the chunk.
///
/// the best means the reused chunks contains all modules in this ModuleGroup
fn find_the_best_reusable_chunk(
&self,
compilation: &mut Compilation,
Expand Down Expand Up @@ -234,7 +236,7 @@ impl SplitChunksPlugin {
if let Some(reusable_chunk) = self.find_the_best_reusable_chunk(compilation, module_group) && module_group.cache_group_reuse_existing_chunk {
*is_reuse_existing_chunk = true;
*is_reuse_existing_chunk_with_all_modules = true;
return reusable_chunk;
reusable_chunk
} else if let Some(chunk_name) = &module_group.chunk_name {
let new_chunk = Compilation::add_named_chunk(
chunk_name.clone(),
Expand Down

0 comments on commit 5eff55d

Please sign in to comment.