I'm wondering what a dune file looks like for a library (rather than an executable) which compiles to js_of_ocaml and why is it recommended to use an executable instead?
How does one use dune to create a js_of_ocaml library?
478 views Asked by et4te At
1
You don't need to do anything particular for libraries to make them compatible with js_of_ocaml: js_of_ocaml works on the final executable bytecode, regardless of the libraries.
That being said, if you want to use js-specific things, js_of_ocaml is also an ocaml library that you can just depends on and which will contain bindings to various javascript functions.
For building js files, you should use the executable stanza (as per the dune docs).