Skip to content

Commit c580e71

Browse files
authored
Merge pull request #4902 from rescript-lang/mjs_for_runtime_stdlib
.mjs for runtime stdlib files, allows node to use directly
2 parents 2155383 + 10d2a88 commit c580e71

File tree

173 files changed

+366
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+366
-362
lines changed

jscomp/core/js_name_of_module_id.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ let get_runtime_module_path
4343
module_system in
4444
let js_file =
4545
Ext_namespace.js_name_of_modulename dep_module_id.id.name
46-
Little Js in (* Js may be subject to the module system *)
46+
Little (match module_system with NodeJS -> Js | Es6 | Es6_global -> Mjs) in
4747
match current_info_query with
4848
| Package_not_found -> assert false
4949
| Package_script ->

jscomp/core/js_packages_info.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ type t =
8282
let runtime_package_specs : t = {
8383
name = Pkg_runtime;
8484
module_systems =[
85-
{module_system = Es6; path = "lib/es6"; suffix = Js};
85+
{module_system = Es6; path = "lib/es6"; suffix = Mjs};
8686
{module_system = NodeJS; path = "lib/js"; suffix = Js};
8787
]
8888
}

jscomp/main/cmij_main.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ let from_cmj ~mode (files : string list) (output_file : string) : unit =
6767
when package_spec = Js_packages_info.runtime_package_specs
6868
-> ()
6969
(*TODO: assert its suffixes*)
70-
| _ -> assert false
70+
| _ ->
71+
Format.fprintf Format.err_formatter
72+
"@[%s: @[%a@]@]@." file
73+
Js_packages_info.dump_packages_info content.package_spec;
74+
assert false
7175
end
7276
| Playground _ -> ()
7377
in

jscomp/others/release.ninja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
bsc_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 -warn-error A -open Bs_stdlib_mini -I ./runtime
2+
bsc_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6:.mjs -nopervasives -unsafe -w +50 -warn-error A -open Bs_stdlib_mini -I ./runtime
33

44
rule cc
55
command = $bsc -bs-cmi -bs-cmj $bsc_flags -I others $in

jscomp/runtime/release.ninja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
bsc_no_open_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 -warn-error A
2+
bsc_no_open_flags = -no-keep-locs -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6:.mjs -nopervasives -unsafe -w +50 -warn-error A
33
bsc_flags = $bsc_no_open_flags -open Bs_stdlib_mini
44

55
rule cc

0 commit comments

Comments
 (0)