Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/node_binding/src/rsdoctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct JsRsdoctorModule {
pub belong_modules: Vec<i32>,
pub chunks: Vec<i32>,
pub issuer_path: Vec<i32>,
pub bailout_reason: Option<String>,
pub bailout_reason: Vec<String>,
}

impl From<RsdoctorModule> for JsRsdoctorModule {
Expand All @@ -50,7 +50,7 @@ impl From<RsdoctorModule> for JsRsdoctorModule {
.into_iter()
.filter_map(|i| i.ukey)
.collect::<Vec<_>>(),
bailout_reason: value.bailout_reason,
bailout_reason: value.bailout_reason.into_iter().collect::<Vec<_>>(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rspack_plugin_rsdoctor/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub struct RsdoctorModule {
pub modules: HashSet<ModuleUkey>,
pub belong_modules: HashSet<ModuleUkey>,
pub issuer_path: Option<Vec<RsdoctorStatsModuleIssuer>>,
pub bailout_reason: Option<String>,
pub bailout_reason: HashSet<String>,
}

#[derive(Debug, Default)]
Expand Down
2 changes: 1 addition & 1 deletion crates/rspack_plugin_rsdoctor/src/module_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub fn collect_modules(
belong_modules: HashSet::default(),
chunks,
issuer_path: None,
bailout_reason: None,
bailout_reason: HashSet::default(),
},
)
})
Expand Down
4 changes: 1 addition & 3 deletions crates/rspack_plugin_rsdoctor/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,9 @@ async fn optimize_chunk_modules(&self, compilation: &mut Compilation) -> Result<

if let Some(rsd_module) = rsd_modules.get_mut(&module_id) {
rsd_module.issuer_path = Some(issuer_path);
}
if let Some(rsd_module) = rsd_modules.get_mut(&module_id) {
let (_, module) = module;
let bailout_reason = module_graph.get_optimization_bailout(&module.identifier());
rsd_module.bailout_reason = Some(bailout_reason.join(", "));
rsd_module.bailout_reason = bailout_reason.iter().map(|s| s.to_string()).collect();
}
}

Expand Down
Loading