-
Notifications
You must be signed in to change notification settings - Fork 197
Description
I'm trying to move from dynamically loading .cma/.cmo files to loading "precompiled" .js files as mentioned here: #480, however I have been unsuccessful so far.
I'm using Topdirs.dir_load Format.std_formatter foo_file to load the files so they can be executed without giving a Error: Reference to undefined global Foo' error.
It's unclear however to me how this should work with JS files.
I did try to use Dynlink.loadfile but that resulted in: The dynlink.cma library cannot be used inside the OCaml toplevel. Note that I used jsoo_mktop -package dynlink ... for this.
This works for me when using Topdirs.dir_load Format.std_formatter foo_file:
js_of_ocaml --file foo.cma --extern-fs -I . --ofs=fs.js
but what I want to get to work is:
js_of_ocaml --pretty foo.cma
cat foo.js >> fs.js
Some guidance would be much appreciated.