File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -839,6 +839,10 @@ impl Package {
839
839
self . config . get_jsx_module_args ( )
840
840
}
841
841
842
+ pub fn get_jsx_preserve_args ( & self ) -> Vec < String > {
843
+ self . config . get_jsx_preserve_args ( )
844
+ }
845
+
842
846
pub fn get_uncurried_args ( & self , version : & str , root_package : & packages:: Package ) -> Vec < String > {
843
847
root_package. config . get_uncurried_args ( version)
844
848
}
Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ pub fn parser_args(
272
272
let jsx_args = root_config. get_jsx_args ( ) ;
273
273
let jsx_module_args = root_config. get_jsx_module_args ( ) ;
274
274
let jsx_mode_args = root_config. get_jsx_mode_args ( ) ;
275
+ let jsx_preserve_args = root_config. get_jsx_preserve_args ( ) ;
275
276
let uncurried_args = root_config. get_uncurried_args ( version) ;
276
277
let bsc_flags = config:: flatten_flags ( & config. bsc_flags ) ;
277
278
@@ -285,6 +286,7 @@ pub fn parser_args(
285
286
jsx_args,
286
287
jsx_module_args,
287
288
jsx_mode_args,
289
+ jsx_preserve_args,
288
290
uncurried_args,
289
291
bsc_flags,
290
292
vec ! [
Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ pub struct JsxSpecs {
184
184
pub mode : Option < JsxMode > ,
185
185
#[ serde( rename = "v3-dependencies" ) ]
186
186
pub v3_dependencies : Option < Vec < String > > ,
187
+ pub preserve : Option < bool > ,
187
188
}
188
189
189
190
/// We do not care about the internal structure because the gentype config is loaded by bsc.
@@ -434,6 +435,16 @@ impl Config {
434
435
}
435
436
}
436
437
438
+ pub fn get_jsx_preserve_args ( & self ) -> Vec < String > {
439
+ match self . jsx . to_owned ( ) {
440
+ Some ( jsx) => match jsx. preserve {
441
+ Some ( true ) => vec ! [ "-bs-jsx-preserve" . to_string( ) ] ,
442
+ _ => vec ! [ ] ,
443
+ } ,
444
+ _ => vec ! [ ] ,
445
+ }
446
+ }
447
+
437
448
pub fn get_uncurried_args ( & self , version : & str ) -> Vec < String > {
438
449
match check_if_rescript11_or_higher ( version) {
439
450
Ok ( true ) => match self . uncurried . to_owned ( ) {
You can’t perform that action at this time.
0 commit comments