File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 "././" *)
You can’t perform that action at this time.
0 commit comments