diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ad3f48d3a..02fc0fae9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ #### :bug: Bug Fix - Fix implementation of directives https://github.com/rescript-lang/rescript-compiler/pull/6052 +- Fix issue if the `lib` dir is included in the sources of bsconfig.json https://github.com/rescript-lang/rescript-compiler/pull/6055 #### :rocket: New Feature - Add support for toplevel `await` https://github.com/rescript-lang/rescript-compiler/pull/6054 diff --git a/jscomp/bsb/bsb_parse_sources.ml b/jscomp/bsb/bsb_parse_sources.ml index c10aef4e8f..e9969e957d 100644 --- a/jscomp/bsb/bsb_parse_sources.ml +++ b/jscomp/bsb/bsb_parse_sources.ml @@ -298,6 +298,9 @@ and parsing_single_source ({ package_kind; is_dev; cwd } as cxt) let dir = match map.?(Bsb_build_schemas.dir) with | Some (Str { str }) -> + if str = Literals.library_file then + Bsb_exception.config_error x (Printf.sprintf "dir field should be different from `%s`" Literals.library_file) + else Ext_path.simple_convert_node_path_to_os_path str | Some x -> Bsb_exception.config_error x "dir expected to be a string" diff --git a/lib/4.06.1/rescript.ml b/lib/4.06.1/rescript.ml index 304ee174aa..629e4e6b4f 100644 --- a/lib/4.06.1/rescript.ml +++ b/lib/4.06.1/rescript.ml @@ -10333,6 +10333,9 @@ and parsing_single_source ({ package_kind; is_dev; cwd } as cxt) let dir = match map.?(Bsb_build_schemas.dir) with | Some (Str { str }) -> + if str = Literals.library_file then + Bsb_exception.config_error x (Printf.sprintf "dir field should be different from `%s`" Literals.library_file) + else Ext_path.simple_convert_node_path_to_os_path str | Some x -> Bsb_exception.config_error x "dir expected to be a string"