(executables
 (names viewer_js) ;; add converter & viewer
 (libraries js_of_ocaml-lwt)
 (modes js wasm)
 (modules
  (:standard
   \
   scene_extents
   svg
   main
   viewer
   converter
   dot_lexer
   dot_graph
   dot_render))
 (js_of_ocaml
  (compilation_mode separate)
  (build_runtime_flags :standard --file %{dep:scene.json}))
 (preprocess
  (pps js_of_ocaml-ppx js_of_ocaml-ppx_deriving_json)))

(ocamllex dot_lexer)

(alias
 (name default)
 (deps viewer_js.bc.js scene.json index.html))

(alias
 (name default)
 (enabled_if %{env:WASM_OF_OCAML=false})
 (deps viewer_js.bc.wasm.js index-wasm.html))
