@@ -61,7 +61,7 @@ pub fn remove_compile_assets(package: &packages::Package, source_file: &Path) {
61
61
}
62
62
}
63
63
64
- fn clean_source_files ( build_state : & BuildState , root_config : & Config , suffix : & str ) {
64
+ fn clean_source_files ( build_state : & BuildState , root_config : & Config ) {
65
65
// get all rescript file locations
66
66
let rescript_file_locations = build_state
67
67
. modules
@@ -77,7 +77,7 @@ fn clean_source_files(build_state: &BuildState, root_config: &Config, suffix: &s
77
77
Some ( (
78
78
package. path . join ( & source_file. implementation . path ) ,
79
79
match spec. suffix {
80
- None => suffix . to_owned ( ) ,
80
+ None => root_config . get_suffix ( & spec ) ,
81
81
Some ( suffix) => suffix,
82
82
} ,
83
83
) )
@@ -367,19 +367,40 @@ pub fn clean(path: &Path, show_progress: bool, snapshot_output: bool, clean_dev_
367
367
let mut build_state = BuildState :: new ( project_context, packages, bsc_path) ;
368
368
packages:: parse_packages ( & mut build_state) ;
369
369
let root_config = build_state. get_root_config ( ) ;
370
- let suffix = build_state. project_context . get_suffix ( ) ;
370
+ let suffix_for_print = if snapshot_output || !show_progress {
371
+ String :: new ( )
372
+ } else {
373
+ match root_config. package_specs {
374
+ None => match & root_config. suffix {
375
+ None => String :: from ( ".js" ) ,
376
+ Some ( suffix) => suffix. clone ( ) ,
377
+ } ,
378
+ Some ( _) => root_config
379
+ . get_package_specs ( )
380
+ . into_iter ( )
381
+ . filter_map ( |spec| {
382
+ if spec. in_source {
383
+ spec. suffix . or_else ( || root_config. suffix . clone ( ) )
384
+ } else {
385
+ None
386
+ }
387
+ } )
388
+ . collect :: < Vec < String > > ( )
389
+ . join ( ", " ) ,
390
+ }
391
+ } ;
371
392
372
393
if !snapshot_output && show_progress {
373
394
println ! (
374
395
"{} {}Cleaning {} files..." ,
375
396
style( "[2/2]" ) . bold( ) . dim( ) ,
376
397
SWEEP ,
377
- suffix
398
+ suffix_for_print
378
399
) ;
379
400
let _ = std:: io:: stdout ( ) . flush ( ) ;
380
401
}
381
402
382
- clean_source_files ( & build_state, root_config, & suffix ) ;
403
+ clean_source_files ( & build_state, root_config) ;
383
404
let timing_clean_mjs_elapsed = timing_clean_mjs. elapsed ( ) ;
384
405
385
406
if !snapshot_output && show_progress {
@@ -388,7 +409,7 @@ pub fn clean(path: &Path, show_progress: bool, snapshot_output: bool, clean_dev_
388
409
LINE_CLEAR ,
389
410
style( "[2/2]" ) . bold( ) . dim( ) ,
390
411
SWEEP ,
391
- suffix ,
412
+ suffix_for_print ,
392
413
timing_clean_mjs_elapsed. as_secs_f64( )
393
414
) ;
394
415
let _ = std:: io:: stdout ( ) . flush ( ) ;
0 commit comments