diff --git a/.changeset/fuzzy-kangaroos-help.md b/.changeset/fuzzy-kangaroos-help.md new file mode 100644 index 000000000000..ee7e36df7571 --- /dev/null +++ b/.changeset/fuzzy-kangaroos-help.md @@ -0,0 +1,5 @@ +--- +preset_env_base: patch +--- + +fix(es/transforms): Pass `unresolved_mark` to `simplifier` instead of `top_level_mark` diff --git a/.changeset/many-camels-chew.md b/.changeset/many-camels-chew.md new file mode 100644 index 000000000000..94971acefb79 --- /dev/null +++ b/.changeset/many-camels-chew.md @@ -0,0 +1,6 @@ +--- +swc: patch +swc_core: patch +--- + +fix(es/transforms): Pass `unresolved_mark` to `simplifier` instead of `top_level_mark` diff --git a/crates/swc/src/config/mod.rs b/crates/swc/src/config/mod.rs index 96303157ebc0..61f2af59e714 100644 --- a/crates/swc/src/config/mod.rs +++ b/crates/swc/src/config/mod.rs @@ -470,13 +470,13 @@ impl Options { match opts { SimplifyOption::Bool(allow_simplify) => { if *allow_simplify { - Some(simplifier(top_level_mark, Default::default())) + Some(simplifier(unresolved_mark, Default::default())) } else { None } } SimplifyOption::Json(cfg) => Some(simplifier( - top_level_mark, + unresolved_mark, SimplifyConfig { dce: DceConfig { preserve_imports_with_side_effects: cfg