(executables
  (names viewer_js) ;; add converter & viewer
  (libraries js_of_ocaml-lwt)
  (preprocess (pps js_of_ocaml-ppx)))

(ocamllex dot_lexer)

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

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