@@ -61,7 +61,7 @@ pub fn remove_compile_assets(package: &packages::Package, source_file: &Path) {
6161 }
6262}
6363
64- fn clean_source_files ( build_state : & BuildState , root_config : & Config , suffix : & str ) {
64+ fn clean_source_files ( build_state : & BuildState , root_config : & Config ) {
6565 // get all rescript file locations
6666 let rescript_file_locations = build_state
6767 . modules
@@ -77,7 +77,7 @@ fn clean_source_files(build_state: &BuildState, root_config: &Config, suffix: &s
7777 Some ( (
7878 package. path . join ( & source_file. implementation . path ) ,
7979 match spec. suffix {
80- None => suffix . to_owned ( ) ,
80+ None => root_config . get_suffix ( & spec ) ,
8181 Some ( suffix) => suffix,
8282 } ,
8383 ) )
@@ -367,19 +367,40 @@ pub fn clean(path: &Path, show_progress: bool, snapshot_output: bool, clean_dev_
367367 let mut build_state = BuildState :: new ( project_context, packages, bsc_path) ;
368368 packages:: parse_packages ( & mut build_state) ;
369369 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+ } ;
371392
372393 if !snapshot_output && show_progress {
373394 println ! (
374395 "{} {}Cleaning {} files..." ,
375396 style( "[2/2]" ) . bold( ) . dim( ) ,
376397 SWEEP ,
377- suffix
398+ suffix_for_print
378399 ) ;
379400 let _ = std:: io:: stdout ( ) . flush ( ) ;
380401 }
381402
382- clean_source_files ( & build_state, root_config, & suffix ) ;
403+ clean_source_files ( & build_state, root_config) ;
383404 let timing_clean_mjs_elapsed = timing_clean_mjs. elapsed ( ) ;
384405
385406 if !snapshot_output && show_progress {
@@ -388,7 +409,7 @@ pub fn clean(path: &Path, show_progress: bool, snapshot_output: bool, clean_dev_
388409 LINE_CLEAR ,
389410 style( "[2/2]" ) . bold( ) . dim( ) ,
390411 SWEEP ,
391- suffix ,
412+ suffix_for_print ,
392413 timing_clean_mjs_elapsed. as_secs_f64( )
393414 ) ;
394415 let _ = std:: io:: stdout ( ) . flush ( ) ;
0 commit comments