Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 548

Dune: how to depend and include a generated .js file into a .ml

$
0
0

Hi,

I have a web server library which should embed a js_of_ocaml-generated .js file. Embedding is done using ppx_blob. But I can’t find the way to:

  • tell dune that this library depends on this generated .js file,
  • refer to this file to pass it to ppx_blob.

My current dune file looks like

(library
 (name toto_server)
 (public_name toto_server)
 (wrapped true)
 (flags ...)
 (libraries ...)
 (modules ...)
 (preprocess (pps ... ppx_blob))
 (preprocessor_deps
   (file toto_server_client_js)
 )
)

(executable
  (modes js)
  (name toto_server_client_js)
  (flags ...)
  (libraries ...)
  (modules toto_server_client_js)
  (preprocess (pps js_of_ocaml-ppx))
)

By now, dune complains about the preprocess rule of the library with:

Error: No rule found for server/toto_server_client_js

And I guess that ppx_blob will not find the file if I simply put

let server_client_js = [%blob "toto_server_client.js"]

What’s the right way to achieve this ?

4 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 548

Latest Images

Trending Articles



Latest Images