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

fix(es/minifier): Change the default of mangle.toplevel to false #6439

Merged
merged 6 commits into from Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
Expand Up @@ -58,7 +58,7 @@ pub struct MangleOptions {
#[serde(default, alias = "properties")]
pub props: Option<ManglePropertiesOptions>,

#[serde(default = "true_by_default", alias = "toplevel")]
#[serde(default, alias = "toplevel")]
pub top_level: bool,

#[serde(default, alias = "keep_classnames")]
Expand Down
4 changes: 1 addition & 3 deletions crates/swc_plugin_runner/src/memory_interop.rs
Expand Up @@ -32,9 +32,7 @@ where
let serialized_len = serialized_bytes.as_ptr().1;

let ptr_start: u32 = get_allocated_ptr(serialized_len);
let ptr_start_size: u32 = ptr_start
.try_into()
.unwrap_or_else(|_| panic!("Should be able to convert the value {} to u32", ptr_start));
let ptr_start_size: u32 = ptr_start;
let serialized_len_size: u32 = serialized_len.try_into().unwrap_or_else(|_| {
panic!(
"Should be able to convert the value {} to u32",
Expand Down