File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -969,17 +969,21 @@ impl AppProject {
969969 . turbopack_remove_unused_imports ( next_mode)
970970 . await ?;
971971
972- let binding_usage_info = remove_unused_imports. then ( || {
973- compute_binding_usage_info (
974- ModuleGraph :: from_graphs ( graphs. clone ( ) ) ,
972+ let ( full, binding_usage_info) = if remove_unused_imports {
973+ let full_with_unused_references = ModuleGraph :: from_graphs ( graphs. clone ( ) ) ;
974+ let binding_usage_info = compute_binding_usage_info (
975+ full_with_unused_references,
975976 should_read_binding_usage,
977+ ) ;
978+ (
979+ ModuleGraph :: from_graphs_without_unused_references (
980+ graphs,
981+ binding_usage_info,
982+ ) ,
983+ Some ( binding_usage_info) ,
976984 )
977- } ) ;
978-
979- let full = if let Some ( binding_usage_info) = binding_usage_info {
980- ModuleGraph :: from_graphs_without_unused_references ( graphs, binding_usage_info)
981985 } else {
982- ModuleGraph :: from_graphs ( graphs)
986+ ( ModuleGraph :: from_graphs ( graphs) , None )
983987 } ;
984988
985989 Ok ( BaseAndFullModuleGraph {
You can’t perform that action at this time.
0 commit comments