Skip to content

Commit c7f0e4d

Browse files
authored
perf(es/minifier): Remove pre-compress pass (#10932)
1 parent 65534ff commit c7f0e4d

File tree

3 files changed

+0
-116
lines changed

3 files changed

+0
-116
lines changed

crates/swc_ecma_minifier/src/lib.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use swc_common::{comments::Comments, pass::Repeated, sync::Lrc, SourceMap, Synta
4444
use swc_ecma_ast::*;
4545
use swc_ecma_transforms_optimization::debug_assert_valid;
4646
use swc_ecma_usage_analyzer::marks::Marks;
47-
use swc_ecma_utils::ExprCtx;
4847
use swc_ecma_visit::VisitMutWith;
4948
use swc_timer::timer;
5049

@@ -57,7 +56,6 @@ use crate::{
5756
pass::{
5857
global_defs, mangle_names::idents_to_preserve, mangle_props::mangle_properties,
5958
merge_exports::merge_exports, postcompress::postcompress_optimizer,
60-
precompress::precompress_optimizer,
6159
},
6260
// program_data::ModuleInfo,
6361
timing::Timings,
@@ -124,18 +122,6 @@ pub fn optimize(
124122
}
125123
}
126124

127-
if let Some(_options) = &options.compress {
128-
let _timer = timer!("precompress");
129-
130-
n.visit_mut_with(&mut precompress_optimizer(ExprCtx {
131-
unresolved_ctxt: SyntaxContext::empty().apply_mark(marks.unresolved_mark),
132-
is_unresolved_ref_safe: false,
133-
in_strict: false,
134-
remaining_depth: 6,
135-
}));
136-
debug_assert_valid(&n);
137-
}
138-
139125
if options.compress.is_some() {
140126
n.visit_mut_with(&mut info_marker(
141127
options.compress.as_ref(),

crates/swc_ecma_minifier/src/pass/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ pub mod mangle_names;
33
pub mod mangle_props;
44
pub mod merge_exports;
55
pub mod postcompress;
6-
pub mod precompress;

crates/swc_ecma_minifier/src/pass/precompress.rs

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)