Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9f29767

Browse files
committedOct 17, 2024·
add project root to default config
1 parent cde3e6a commit 9f29767

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed
 

‎compiler/gentype/GenTypeConfig.ml

+24-4
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,26 @@ let set_debug ~gtconf =
105105
let compiler_config_file = "rescript.json"
106106
let legacy_compiler_config_file = "bsconfig.json"
107107

108+
let default_config ~project_root ~bsb_project_root =
109+
{
110+
project_root;
111+
bsb_project_root;
112+
bs_dependencies = default.bs_dependencies;
113+
suffix = default.suffix;
114+
emit_import_curry = default.emit_import_curry;
115+
emit_import_react = default.emit_import_react;
116+
emit_type_prop_done = default.emit_type_prop_done;
117+
everything = default.everything;
118+
export_interfaces = default.export_interfaces;
119+
generated_file_extension = default.generated_file_extension;
120+
module_ = default.module_;
121+
module_resolution = default.module_resolution;
122+
namespace = default.namespace;
123+
platform_lib = default.platform_lib;
124+
shims_map = default.shims_map;
125+
sources = default.sources;
126+
}
127+
108128
let rec find_project_root ~dir =
109129
if
110130
Sys.file_exists (Filename.concat dir compiler_config_file)
@@ -247,7 +267,7 @@ let read_config ~get_config_file ~namespace =
247267
| Obj {map = bsconf} -> (
248268
match bsconf |> get_opt "gentypeconfig" with
249269
| Some (Obj {map = gtconf}) -> parse_config ~bsconf ~gtconf
250-
| _ -> default)
251-
| _ -> default
252-
with _ -> default)
253-
| None -> default
270+
| _ -> default_config ~project_root ~bsb_project_root)
271+
| _ -> default_config ~project_root ~bsb_project_root
272+
with _ -> default_config ~project_root ~bsb_project_root)
273+
| None -> default_config ~project_root ~bsb_project_root

0 commit comments

Comments
 (0)
Please sign in to comment.