Skip to content

Commit a2d0a64

Browse files
committed
seems to work with js
1 parent d63640c commit a2d0a64

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

jscomp/js.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ set -e
33
## building js
44
# ocamlbuild -use-ocamlfind -no-hygiene -syntax camlp4o -pkgs js_of_ocaml,js_of_ocaml.syntax,js_of_ocaml.toplevel exports.byte
55

6-
ocamlbuild -lflags -no-check-prims -use-ocamlfind -no-hygiene -pkgs compiler-libs.toplevel -no-links jsoo_exports.byte
7-
js_of_ocaml -I +compiler-libs --toplevel +dynlink.js +toplevel.js +weak.js _build/jsoo_exports.byte -o _build/exports.js
6+
ocamlbuild -lflags -no-check-prims -use-ocamlfind -no-hygiene -pkgs compiler-libs.bytecomp -no-links jsoo_exports.byte
7+
js_of_ocaml -I +compiler-libs --toplevel +dynlink.js +toplevel.js +weak.js _build/jsoo_exports.byte -I ./runtime/ --file js.cmi:/cmis -o _build/exports.js
88

9+
rm -rf $BUCKLESCRIPT_DOC/js-demo/exports.js && cp _build/exports.js $BUCKLESCRIPT_DOC/js-demo/
910

10-
rm -rf $BUCKLESCRIPT_DOC/js-demo/exports.js && cp _build/exports.js $BUCKLESCRIPT_DOC/js-demo/exports.js
11-
12-
ocamlbuild -use-ocamlfind -no-hygiene -no-links js_generate_require.byte --
13-
rm -rf $BUCKLESCRIPT_DOC/js-demo/pre_load.js
14-
cp ./pre_load.js $BUCKLESCRIPT_DOC/js-demo/
15-
# TODO: build with amd first
16-
cp ../lib/amdjs/*.js $BUCKLESCRIPT_DOC/js-demo/stdlib
11+
# ocamlbuild -use-ocamlfind -no-hygiene -no-links js_generate_require.byte --
12+
# rm -rf $BUCKLESCRIPT_DOC/js-demo/pre_load.js
13+
# cp ./pre_load.js $BUCKLESCRIPT_DOC/js-demo/
14+
# # TODO: build with amd first
15+
# cp ../lib/amdjs/*.js $BUCKLESCRIPT_DOC/js-demo/stdlib
1716

1817

1918

jscomp/jsoo_exports.ml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,17 @@ let export (field : string) v =
5353
Js.Unsafe.set (Js.Unsafe.global) field v
5454
;;
5555

56+
(* To add a directory to the load path *)
57+
58+
let dir_directory d =
59+
Config.load_path := d :: !Config.load_path
60+
5661

5762
let () =
58-
Sys.interactive := false;
59-
Topdirs.dir_directory "/cmis";
60-
Toploop.initialize_toplevel_env ();
61-
Toploop.input_name := "//toplevel//";
63+
Sys.interactive := false; (* TODO: remove *)
64+
dir_directory "/cmis";
65+
(* Toploop.initialize_toplevel_env (); *)
66+
(* Toploop.input_name := "//toplevel//"; *)
6267
Sys.interactive := true
6368

6469

0 commit comments

Comments
 (0)