Skip to content

Instantly share code, notes, and snippets.

@serioga
Created August 10, 2021 07:24
Show Gist options
  • Save serioga/7194c0d9487027a7d515870b07432216 to your computer and use it in GitHub Desktop.
Save serioga/7194c0d9487027a7d515870b07432216 to your computer and use it in GitHub Desktop.
CLJS REPL in browser.
(ns dev.env.cljs-repl.browser
"CLJS REPL in browser. See https://clojurescript.org/reference/repl.
Run local clojure.main REPL with `-m dev.env.cljs-repl.browser` parameters to work from Cursive."
(:require [cljs.repl :as repl]
[cljs.repl.browser :as browser]))
;•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
(def ^:private output-dir "out/repl/browser")
(defn- -main
[]
(-> (browser/repl-env :output-dir output-dir)
(repl/repl :output-dir output-dir
:quit-prompt (fn []
(repl/repl-title)
(repl/repl-quit-prompt)))))
(comment (-main))
;•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
#?(:cljs (comment (js/alert "Hello CLJS!")
:cljs/quit))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment