Skip to content

Commit 22e4f13

Browse files
committed
Another windows thing
1 parent aebccbd commit 22e4f13

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

compiler/core/lam_compile_main.ml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,16 @@ let lambda_as_module
309309
- For rewatch: path already contains full directory from file_path.parent()
310310
- basename is the final filename *)
311311
let target_file =
312-
if path = "." || path = "lib/bs" || path = "lib/js" || path = "lib/es6" || path = "lib/es6-global" then
312+
(* Check if path is a base output directory (bsb mode) vs full path (rewatch mode)
313+
Use starts_with to handle both Unix (lib/es6) and Windows (lib\es6) paths *)
314+
let is_base_path =
315+
path = "." ||
316+
Ext_string.starts_with path "lib" &&
317+
(Ext_string.contain_substring path "bs" ||
318+
Ext_string.contain_substring path "js" ||
319+
Ext_string.contain_substring path "es6")
320+
in
321+
if is_base_path then
313322
(* Legacy bsb mode: path is base dir, extract source subdir from output_prefix *)
314323
let source_subdir = Filename.dirname output_prefix in
315324
(* When source_subdir is ".", don't include it in the path to avoid "././" *)

0 commit comments

Comments
 (0)