Skip to content

Commit fafc861

Browse files
committed
fix playground
1 parent e93eb8c commit fafc861

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

jscomp/jsoo/jsoo_playground_main.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ end
7474

7575
module BundleConfig = struct
7676
type t = {
77-
mutable module_system: Js_packages_info.module_system;
77+
mutable module_system: Ext_module_system.t;
7878
mutable filename: string option;
7979
mutable warn_flags: string;
8080
mutable open_modules: string list;
@@ -86,7 +86,7 @@ module BundleConfig = struct
8686
}
8787

8888
let make () = {
89-
module_system=Js_packages_info.NodeJS;
89+
module_system=Ext_module_system.Commonjs;
9090
filename=None;
9191
warn_flags=Bsc_warnings.defaults_w;
9292
open_modules=[];
@@ -97,8 +97,8 @@ module BundleConfig = struct
9797
let default_filename (lang: Lang.t) = "playground." ^ (Lang.toString lang)
9898

9999
let string_of_module_system m = (match m with
100-
| Js_packages_info.NodeJS -> "nodejs"
101-
| Es6 -> "es6"
100+
| Ext_module_system.Commonjs -> "nodejs"
101+
| Esmodule -> "es6"
102102
| Es6_global -> "es6_global")
103103
end
104104

@@ -608,10 +608,10 @@ module Export = struct
608608
let config = BundleConfig.make () in
609609
let set_module_system value =
610610
match value with
611-
| "es6" ->
612-
config.module_system <- Js_packages_info.Es6; true
613-
| "nodejs" ->
614-
config.module_system <- NodeJS; true
611+
| "esmodule" | "es6" ->
612+
config.module_system <- Ext_module_system.Esmodule; true
613+
| "commonjs" | "nodejs" ->
614+
config.module_system <- Commonjs; true
615615
| _ -> false in
616616
let set_filename value =
617617
config.filename <- Some value; true

packages/playground-bundling/bsconfig.json renamed to packages/playground-bundling/rescript.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"bs-dependencies": ["@rescript/react", "@rescript/core"],
55
"package-specs": {
6-
"module": "es6",
6+
"module": "esmodule",
77
"in-source": false
88
},
99
"sources": {

packages/playground-bundling/scripts/generate_cmijs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* rescript version as the compiler bundle.
77
*
88
* This script extracts all cmi / cmj files of the rescript/lib/ocaml and all
9-
* dependencies listed in the project root's bsconfig.json, creates cmij.js
9+
* dependencies listed in the project root's rescript.json, creates cmij.js
1010
* files for each library and puts them in the compiler playground directory.
1111
*
1212
* The cmij files are representing the marshaled dependencies that can be used with the ReScript
@@ -17,7 +17,7 @@ const child_process = require("child_process");
1717
const fs = require("fs");
1818
const path = require("path");
1919

20-
const bsconfig = require("../bsconfig.json");
20+
const resConfig = require("../rescript.json");
2121

2222
const RESCRIPT_COMPILER_ROOT_DIR = path.join(__dirname, "..", "..", "..");
2323
const PLAYGROUND_DIR = path.join(RESCRIPT_COMPILER_ROOT_DIR, "playground");
@@ -51,7 +51,7 @@ e(`npm link ${RESCRIPT_COMPILER_ROOT_DIR}`);
5151
e(`npx rescript clean`);
5252
e(`npx rescript`);
5353

54-
const packages = bsconfig["bs-dependencies"];
54+
const packages = resConfig["bs-dependencies"];
5555

5656
// We need to build the compiler's builtin modules as a separate cmij.
5757
// Otherwise we can't use them for compilation within the playground.

0 commit comments

Comments
 (0)