Skip to content

Commit

Permalink
chore(es/minifier): expose globals_defs pass
Browse files Browse the repository at this point in the history
  • Loading branch information
hyf0 committed Dec 13, 2022
1 parent 754c484 commit 33c328e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions crates/swc_ecma_minifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use swc_ecma_usage_analyzer::marks::Marks;
use swc_ecma_visit::VisitMutWith;
use swc_timer::timer;

pub use crate::pass::unique_scope::unique_scope;
pub use crate::pass::{global_defs::globals_defs, unique_scope::unique_scope};
use crate::{
compress::{compressor, pure_optimizer, PureOptimizerConfig},
metadata::info_marker,
Expand Down Expand Up @@ -111,14 +111,14 @@ pub fn optimize(
// have to see if optimized code matches global definition and we can run
// this at startup.

if !defs.is_empty() {
let defs = defs.iter().map(|(k, v)| (k.clone(), v.clone())).collect();
n.visit_mut_with(&mut global_defs::globals_defs(
defs,
extra.unresolved_mark,
extra.top_level_mark,
));
}
// if !defs.is_empty() {
let defs = defs.iter().map(|(k, v)| (k.clone(), v.clone())).collect();
n.visit_mut_with(&mut global_defs::globals_defs(
defs,
extra.unresolved_mark,
extra.top_level_mark,
));
// }
}

let module_info = match &n {
Expand Down

0 comments on commit 33c328e

Please sign in to comment.