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