Unverified Commit e0008a9e authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

fix(turbopack): Disable ES3 transforms from preset-env (#86532)

Co-authored-by: 's avatarNiklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
parent 77f60a6f
......@@ -8,7 +8,7 @@ use swc_core::{
common::{Mark, SourceMap, comments::Comments},
ecma::{
ast::{ExprStmt, ModuleItem, Pass, Program, Stmt},
preset_env::{self, Targets},
preset_env::{self, Feature, FeatureOrModule, Targets},
transforms::{
base::{
assumptions::Assumptions,
......@@ -210,6 +210,13 @@ impl EcmascriptInputTransform {
swc_core::ecma::preset_env::Config {
targets: Some(Targets::Versions(*versions)),
mode: None, // Don't insert core-js polyfills
// Disable some ancient ES3 transforms, ReservedWords breaks resolving of
// some idents references
exclude: vec![
FeatureOrModule::Feature(Feature::ReservedWords),
FeatureOrModule::Feature(Feature::MemberExpressionLiterals),
FeatureOrModule::Feature(Feature::PropertyLiterals),
],
..Default::default()
},
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment