[adzerk/boot-cljs-repl "0.1.9"] ;; latest release
or
[adzerk/boot-cljs-repl "0.1.10-SNAPSHOT"] ;; current snapshot
Boot task providing a ClojureScript browser REPL via Weasel and Piggieback.
Add boot-cljs-repl
to your build.boot
dependencies and require
the
namespace:
(set-env! :dependencies '[[adzerk/boot-cljs-repl "X.Y.Z" :scope "test"]])
(require '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl])
You can see the options available on the command line:
$ boot cljs-repl -h
or in the REPL:
boot.user=> (doc cljs-repl)
A typical boot.build
file for ClojureScript development:
(set-env!
:src-paths #{"src"}
:dependencies '[[adzerk/boot-cljs "0.0-X-Y" :scope "test"]
[adzerk/boot-cljs-repl "X.Y.Z" :scope "test"]])
(require
'[adzerk.boot-cljs :refer :all]
'[adzerk.boot-cljs-repl :refer :all])
When compiling with optimization level none
and you're not using the -u
option with the cljs
task you must add a script tag to the page HTML to
connect the client to the REPL server:
<!-- Note: This is only needed when optimization level is :none
and the -u (--unified) option is not specified for the cljs task. -->
<script type="text/javascript">goog.require('adzerk.boot_cljs_repl');</script>
Start a build pipeline with file-watcher, ClojureScript REPL server, and compile ClojureScript with source maps, unified HTML loading, and no optimizations:
# note: cljs-repl task must precede cljs task
$ boot watch cljs-repl cljs -usO none
To start evaluating forms in the browser you must first connect to the running
Clojure nREPL server (started by the cljs-repl
task above) and create a new,
browser-connected CLJS REPL.
$ boot repl -c
boot.user=> (start-repl)
M-x cider RET RET RET
boot.user=> (start-repl)
:Piggieback (repl-env)
Copyright © 2014 Adzerk
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.