@@ -11709,6 +11709,8 @@ val refmt : string option ref
1170911709val is_reason : bool ref
1171011710
1171111711val js_stdout : bool ref
11712+
11713+ val all_module_aliases : bool ref
1171211714end = struct
1171311715#1 "js_config.ml"
1171411716(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -11823,6 +11825,8 @@ let refmt = ref None
1182311825let is_reason = ref false
1182411826
1182511827let js_stdout = ref true
11828+
11829+ let all_module_aliases = ref false
1182611830end
1182711831module Bs_warnings : sig
1182811832#1 "bs_warnings.mli"
@@ -112598,7 +112602,10 @@ let prim = Lam.prim
112598112602type required_modules = Lam_module_ident.Hash_set.t
112599112603
112600112604
112601- (** drop Lseq (List! ) etc *)
112605+ (** drop Lseq (List! ) etc
112606+ see #3852, we drop all these required global modules
112607+ but added it back based on our own module analysis
112608+ *)
112602112609let rec drop_global_marker (lam : Lam.t) =
112603112610 match lam with
112604112611 | Lsequence (Lglobal_module id, rest) ->
@@ -116270,20 +116277,19 @@ let compile
116270116277 |> Js_shake.shake_program
116271116278 |> _j "shake"
116272116279 |> ( fun (program: J.program) ->
116273- let external_module_ids =
116274- Lam_compile_env.get_required_modules
116275- may_required_modules
116276- (Js_fold_basic.calculate_hard_dependencies program.block)
116277- |>
116278- (fun x ->
116279- if !Js_config.sort_imports then
116280- Ext_list.sort_via_array x
116281- (fun id1 id2 ->
116282- Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2)
116283- )
116284- else
116285- x
116286- )
116280+ let external_module_ids : Lam_module_ident.t list =
116281+ if !Js_config.all_module_aliases then []
116282+ else
116283+ let x = Lam_compile_env.get_required_modules
116284+ may_required_modules
116285+ (Js_fold_basic.calculate_hard_dependencies program.block) in
116286+ if !Js_config.sort_imports then
116287+ Ext_list.sort_via_array x
116288+ (fun id1 id2 ->
116289+ Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2)
116290+ )
116291+ else
116292+ x
116287116293 in
116288116294 Warnings.check_fatal ();
116289116295 let effect =
0 commit comments