Skip to content
 
 

Repository files navigation

* boot-cljs-devtools
** About
[[https://github.com/boot-clj/boot][Boot]] tasks introducing enhancements to CLJS development in Chrome, specifically [[https://github.com/binaryage/cljs-devtools][CLJS DevTools]] and [[https://github.com/binaryage/dirac][Dirac]].
** Installation
Latest version:

[[https://clojars.org/powerlaces/boot-cljs-devtools][https://img.shields.io/clojars/v/powerlaces/boot-cljs-devtools.svg]]

In order to install it, add the following to your =build.boot= dependencies:
#+BEGIN_SRC clojure
[binaryage/devtools      "X.X.X" :scope "test"] ;; when you want cljd-devtools or both, replace X.X.X for current version
[binaryage/dirac         "X.X.X" :scope "test"] ;; when you want dirac or both, replace X.X.X for current version
[powerlaces/boot-cljs-devtools "0.X.X" :scope "test"]
[org.clojure/clojurescript "1.9.293"] ;; see below
#+END_SRC
Note that boot-cljs-devtools requires ClojureScript version 1.9.89 or later for its =:preloads= feature.

In addition require the task, specifically =cljs-devtools=:
#+BEGIN_SRC clojure
(require '[powerlaces.boot-cljs-devtools :refer [cljs-devtools]])
#+END_SRC

or specifically =dirac=:
#+BEGIN_SRC clojure
(require '[powerlaces.boot-cljs-devtools :refer [dirac]])
#+END_SRC

or both =cljs-devtools= and =dirac=:
#+BEGIN_SRC clojure
(require '[powerlaces.boot-cljs-devtools :refer [cljs-devtools dirac]])
#+END_SRC

Currently files may be generated in the =out= directory, so it would be advisable to add that to someplace like in a =.gitignore=.
** Usage
Ensure that this task runs before the =cljs= and after the =watch= task and that you include a =.cljs.edn= file according to [[https://github.com/adzerk-oss/boot-cljs/wiki/Usage#multiple-builds][this]].

Task example for cljs-devtools:
#+BEGIN_SRC clojure
(deftask dev []
  (comp (watch) (cljs-devtools) (cljs)))
#+END_SRC

Task example for dirac:
#+BEGIN_SRC clojure
(deftask dev []
  (comp (watch) (dirac) (cljs)))
#+END_SRC

Task example for both cljs-devtools and dirac:
#+BEGIN_SRC clojure
(deftask dev []
  (comp (watch) (cljs-devtools) (dirac) (cljs)))
#+END_SRC

File =your-ns.cljs.edn= example:
#+BEGIN_SRC clojure
{:require  [your-ns.core]
 :init-fns [your-ns.core/init]}
#+END_SRC
For more information on the tools please visit [[https://github.com/binaryage/cljs-devtools][CLJS DevTools]] and [[https://github.com/binaryage/dirac][Dirac]].
** Credits
- [[https://github.com/jupl][jupl]] :: for his work, this library would not exist otherwise
- [[https://github.com/binaryage][binaryage]] :: for [[https://github.com/binaryage/cljs-devtools][CLJS DevTools]] and [[https://github.com/binaryage/dirac][Dirac]]
- [[https://github.com/adzerk-oss][adzerk-oss]] :: for [[https://github.com/adzerk-oss/boot-cljs-repl][boot-cljs-repl]] (reference/foundation for this project)
- [[https://github.com/slotkenov][slotkenov]] :: for the original snippet that inspired this project

About

Boot task to add Chrome DevTool enhancements for CLJS.

Topics

Resources

Stars

24 stars

Watchers

8 watching

Forks

Releases

Packages

Contributors

Languages