(executables
 (names viewer_js) ;; add converter & viewer
 (libraries js_of_ocaml-lwt)
 (modes byte)
 (modules
  (:standard
   \
   scene_extents
   svg
   main
   viewer
   converter
   dot_lexer
   dot_graph
   dot_render))
 (preprocess
  (pps js_of_ocaml-ppx)))

(ocamllex dot_lexer)

(rule
 (targets viewer_js.js)
 (action
  (run
   %{bin:js_of_ocaml}
   --source-map
   %{dep:viewer_js.bc}
   -o
   %{targets}
   --pretty
   --file
   %{dep:scene.json})))

(alias
 (name default)
 (deps viewer_js.js index.html))
