@@ -578,7 +578,7 @@ fn compile_file(
578
578
ast_path. to_string_lossy( )
579
579
) ) ,
580
580
} ?;
581
- let module_name = helpers:: file_path_to_module_name ( implementation_file_path, & package. namespace ) ;
581
+ let basename = helpers:: file_path_to_compiler_asset_basename ( implementation_file_path, & package. namespace ) ;
582
582
let has_interface = module. get_interface ( ) . is_some ( ) ;
583
583
let is_type_dev = module. is_type_dev ;
584
584
let to_mjs_args = compiler_args (
@@ -631,40 +631,41 @@ fn compile_file(
631
631
// because editor tooling doesn't support namespace entries yet
632
632
// we just remove the @ for now. This makes sure the editor support
633
633
// doesn't break
634
- . join ( format ! ( "{module_name }.cmi" ) ) ,
635
- ocaml_build_path_abs. join ( format ! ( "{module_name }.cmi" ) ) ,
634
+ . join ( format ! ( "{basename }.cmi" ) ) ,
635
+ ocaml_build_path_abs. join ( format ! ( "{basename }.cmi" ) ) ,
636
636
) ;
637
637
let _ = std:: fs:: copy (
638
638
package
639
639
. get_build_path ( )
640
640
. join ( dir)
641
- . join ( format ! ( "{module_name }.cmj" ) ) ,
642
- ocaml_build_path_abs. join ( format ! ( "{module_name }.cmj" ) ) ,
641
+ . join ( format ! ( "{basename }.cmj" ) ) ,
642
+ ocaml_build_path_abs. join ( format ! ( "{basename }.cmj" ) ) ,
643
643
) ;
644
+ println ! ( "[rewatch] Copying file {basename} to ocaml build path" ) ;
644
645
let _ = std:: fs:: copy (
645
646
package
646
647
. get_build_path ( )
647
648
. join ( dir)
648
649
// because editor tooling doesn't support namespace entries yet
649
650
// we just remove the @ for now. This makes sure the editor support
650
651
// doesn't break
651
- . join ( format ! ( "{module_name }.cmt" ) ) ,
652
- ocaml_build_path_abs. join ( format ! ( "{module_name }.cmt" ) ) ,
652
+ . join ( format ! ( "{basename }.cmt" ) ) ,
653
+ ocaml_build_path_abs. join ( format ! ( "{basename }.cmt" ) ) ,
653
654
) ;
654
655
} else {
655
656
let _ = std:: fs:: copy (
656
657
package
657
658
. get_build_path ( )
658
659
. join ( dir)
659
- . join ( format ! ( "{module_name }.cmti" ) ) ,
660
- ocaml_build_path_abs. join ( format ! ( "{module_name }.cmti" ) ) ,
660
+ . join ( format ! ( "{basename }.cmti" ) ) ,
661
+ ocaml_build_path_abs. join ( format ! ( "{basename }.cmti" ) ) ,
661
662
) ;
662
663
let _ = std:: fs:: copy (
663
664
package
664
665
. get_build_path ( )
665
666
. join ( dir)
666
- . join ( format ! ( "{module_name }.cmi" ) ) ,
667
- ocaml_build_path_abs. join ( format ! ( "{module_name }.cmi" ) ) ,
667
+ . join ( format ! ( "{basename }.cmi" ) ) ,
668
+ ocaml_build_path_abs. join ( format ! ( "{basename }.cmi" ) ) ,
668
669
) ;
669
670
}
670
671
0 commit comments