diff --git a/crates/mako/src/build/transform.rs b/crates/mako/src/build/transform.rs index 542221b11..4249509bc 100644 --- a/crates/mako/src/build/transform.rs +++ b/crates/mako/src/build/transform.rs @@ -235,16 +235,10 @@ impl Context { let is_ts = file.extname == "ts" || file.extname == "tsx"; let mut assumptions = Assumptions::default(); - self.config.js.as_ref().map(|js_config| { - js_config.transform.as_ref().map(|transform_config| { - assumptions.set_public_class_fields |= - !transform_config.use_define_for_class_fields; - if is_ts { - assumptions.set_class_methods |= !transform_config.use_define_for_class_fields; - } - }) - }); - + assumptions.set_public_class_fields |= !self.config.use_define_for_class_fields; + if is_ts { + assumptions.set_class_methods |= !self.config.use_define_for_class_fields; + } assumptions } } diff --git a/crates/mako/src/config/config.rs b/crates/mako/src/config/config.rs index 449c92a51..dc9dfbf4a 100644 --- a/crates/mako/src/config/config.rs +++ b/crates/mako/src/config/config.rs @@ -478,7 +478,7 @@ pub struct Config { pub rsc_client: Option, pub experimental: ExperimentalConfig, pub watch: WatchConfig, - pub js: Option, + pub use_define_for_class_fields: bool, } #[allow(dead_code)] @@ -527,34 +527,6 @@ pub struct OptimizeChunkGroup { #[serde(default, with = "optimize_test_format")] pub test: Option, } -#[derive(Deserialize, Serialize, Clone, Debug)] -#[serde(rename_all = "camelCase")] -pub struct JsConfig { - pub transform: Option, -} - -impl Default for JsConfig { - fn default() -> Self { - JsConfig { - transform: Some(TransformConfig::default()), - } - } -} - -#[derive(Deserialize, Serialize, Clone, Debug)] -#[serde(rename_all = "camelCase")] -pub struct TransformConfig { - #[serde(default)] - pub use_define_for_class_fields: bool, -} - -impl Default for TransformConfig { - fn default() -> Self { - TransformConfig { - use_define_for_class_fields: true, - } - } -} impl Default for OptimizeChunkGroup { fn default() -> Self { @@ -661,9 +633,7 @@ const DEFAULT_CONFIG: &str = r#" "rscServer": false, "rscClient": false, "experimental": { "webpackSyntaxValidate": [] }, - "js": { - "useDefineForClassFields": true - }, + "useDefineForClassFields": true, "watch": { "ignorePaths": [] } } "#;