Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(es/minifier): Enable reduce_funcs by default #6097

Merged
merged 2 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/swc_ecma_minifier/src/option/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ pub struct CompressOptions {
#[serde(alias = "pure_funcs")]
pub pure_funcs: Vec<Box<Expr>>,

#[serde(default)]
#[serde(default = "true_by_default")]
#[serde(alias = "reduce_funcs")]
pub reduce_fns: bool,
#[serde(default)]
Expand Down
3 changes: 1 addition & 2 deletions crates/swc_ecma_minifier/src/option/terser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,7 @@ impl TerserCompressorOptions {
PureGetterOption::Str(v.split(',').map(From::from).collect())
}
},
// TODO: Use self.defaults
reduce_fns: self.reduce_funcs.unwrap_or(false),
reduce_fns: self.reduce_funcs.unwrap_or(self.defaults),
// TODO: Use self.defaults
reduce_vars: self.reduce_vars.unwrap_or(false),
sequences: self
Expand Down