@@ -14,7 +14,6 @@ use swc_core::base::config::{
1414#[ serde( rename_all = "camelCase" , default ) ]
1515pub struct RawRspackExperiments {
1616 pub import : Option < Vec < RawImportOptions > > ,
17- pub collect_type_script_info : Option < RawCollectTypeScriptInfoOptions > ,
1817}
1918
2019#[ derive( Default , Deserialize , Debug ) ]
@@ -27,7 +26,6 @@ pub struct RawCollectTypeScriptInfoOptions {
2726#[ derive( Default , Debug ) ]
2827pub ( crate ) struct RspackExperiments {
2928 pub ( crate ) import : Option < Vec < ImportOptions > > ,
30- pub ( crate ) collect_typescript_info : Option < CollectTypeScriptInfoOptions > ,
3129}
3230
3331#[ derive( Default , Debug ) ]
@@ -49,7 +47,6 @@ impl From<RawRspackExperiments> for RspackExperiments {
4947 import : value
5048 . import
5149 . map ( |i| i. into_iter ( ) . map ( |v| v. into ( ) ) . collect ( ) ) ,
52- collect_typescript_info : value. collect_type_script_info . map ( |v| v. into ( ) ) ,
5350 }
5451 }
5552}
@@ -113,6 +110,9 @@ pub struct SwcLoaderJsOptions {
113110 #[ serde( default ) ]
114111 pub source_map_ignore_list : Option < FilePattern > ,
115112
113+ #[ serde( default ) ]
114+ pub collect_type_script_info : Option < RawCollectTypeScriptInfoOptions > ,
115+
116116 #[ serde( default ) ]
117117 pub rspack_experiments : Option < RawRspackExperiments > ,
118118}
@@ -123,6 +123,7 @@ pub(crate) struct SwcCompilerOptionsWithAdditional {
123123 raw_options : String ,
124124 pub ( crate ) swc_options : Options ,
125125 pub ( crate ) rspack_experiments : RspackExperiments ,
126+ pub ( crate ) collect_typescript_info : Option < CollectTypeScriptInfoOptions > ,
126127}
127128
128129impl AsRefStrConverter for SwcCompilerOptionsWithAdditional {
@@ -156,6 +157,7 @@ impl TryFrom<&str> for SwcCompilerOptionsWithAdditional {
156157 error,
157158 is_module,
158159 schema,
160+ collect_type_script_info,
159161 rspack_experiments,
160162 source_map_ignore_list,
161163 } = option;
@@ -191,6 +193,7 @@ impl TryFrom<&str> for SwcCompilerOptionsWithAdditional {
191193 ..serde_json:: from_value ( serde_json:: Value :: Object ( Default :: default ( ) ) ) ?
192194 } ,
193195 rspack_experiments : rspack_experiments. unwrap_or_default ( ) . into ( ) ,
196+ collect_typescript_info : collect_type_script_info. map ( |v| v. into ( ) ) ,
194197 } )
195198 }
196199}
0 commit comments