How would you structure a dune project for web development with opium and js_of_ocaml?

Currently I’m starting from something like:


What I don’t know how to solve in a reliable and nice way that works both in dev and production:

  1. I want jsoo artefacts copied or linked in static/
  2. static/ itself needs to get copied or linked to a directory which is the root of the opium web server when it starts.

Of course, all other ideas are welcome.

I don’t think you need to change the structure at all, should be possible to make dune work.

I was using alias for dealing with HTML and js_of_ocaml artifacts, but I did not use opium so I have no idea if that’s to be dealt with differently. I also only used a dune file in one sub directory that uses files from other directories, so I have no idea if putting dune in the root directory works.

Basically I have one alias that depends on several other rules, each rule can be just a copy and paste operation, or generation of an artifact etc.