Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
This reverts commit 7c0898e.
  • Loading branch information
kdy1 committed Jul 29, 2024
1 parent 868789d commit fd34007
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/turbopack-ecmascript/src/tree_shake/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use swc_core::{
ExportAll, ExportNamedSpecifier, Id, Ident, ImportDecl, Module, ModuleDecl,
ModuleExportName, ModuleItem, NamedExport, Program,
},
codegen::{text_writer::JsWriter, Emitter},
codegen::{text_writer::JsWriter, to_code, Emitter},
},
};
use turbo_tasks::{RcStr, ValueToString, Vc};
Expand Down Expand Up @@ -493,6 +493,17 @@ pub(super) async fn split(
star_reexports,
} = dep_graph.split_module(&items);

{
let code = to_code(&program);
eprintln!("# Program({}):\n{code}", ident.to_string().await?);
}

for (idx, module) in modules.iter().enumerate() {
let code = to_code(&module);

eprintln!("# Module #{idx}:\n{code}",);
}

assert_ne!(modules.len(), 0, "modules.len() == 0;\nModule: {module:?}",);

for &v in entrypoints.values() {
Expand Down

0 comments on commit fd34007

Please sign in to comment.