mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 02:06:08 +03:00
fix(es/minifier): Don't remove comments if compress
is not configured (#3866)
This commit is contained in:
parent
d9fd79db86
commit
e70c9d8f22
@ -343,6 +343,10 @@ impl VisitMut for MinifierPass {
|
|||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if opts.compress.is_none() && opts.mangle.is_none() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m.map_with_mut(|m| {
|
m.map_with_mut(|m| {
|
||||||
swc_ecma_minifier::optimize(
|
swc_ecma_minifier::optimize(
|
||||||
m,
|
m,
|
||||||
|
@ -91,7 +91,9 @@ pub fn optimize(
|
|||||||
m.visit_mut_with(&mut precompress_optimizer(options, marks));
|
m.visit_mut_with(&mut precompress_optimizer(options, marks));
|
||||||
}
|
}
|
||||||
|
|
||||||
m.visit_mut_with(&mut info_marker(comments, marks, extra.top_level_mark));
|
if options.compress.is_some() {
|
||||||
|
m.visit_mut_with(&mut info_marker(comments, marks, extra.top_level_mark));
|
||||||
|
}
|
||||||
m.visit_mut_with(&mut unique_scope());
|
m.visit_mut_with(&mut unique_scope());
|
||||||
|
|
||||||
if options.wrap {
|
if options.wrap {
|
||||||
|
Loading…
Reference in New Issue
Block a user