Skip to content

boot-clj/boot-cljs-devtools

 
 

Repository files navigation

boot-cljs-devtools

About

Boot tasks introducing enhancements to CLJS development in Chrome, specifically CLJS DevTools and Dirac.

Installation

Latest version:

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

In order to install it, add the following to your build.boot dependencies:

[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

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:

(require '[powerlaces.boot-cljs-devtools :refer [cljs-devtools]])

or specifically dirac:

(require '[powerlaces.boot-cljs-devtools :refer [dirac]])

or both cljs-devtools and dirac:

(require '[powerlaces.boot-cljs-devtools :refer [cljs-devtools dirac]])

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 this.

Task example for cljs-devtools:

(deftask dev []
  (comp (watch) (cljs-devtools) (cljs)))

Task example for dirac:

(deftask dev []
  (comp (watch) (dirac) (cljs)))

Task example for both cljs-devtools and dirac:

(deftask dev []
  (comp (watch) (cljs-devtools) (dirac) (cljs)))

File your-ns.cljs.edn example:

{:require  [your-ns.core]
 :init-fns [your-ns.core/init]}

For more information on the tools please visit CLJS DevTools and Dirac.

Credits

jupl
for his work, this library would not exist otherwise
binaryage
for CLJS DevTools and Dirac
adzerk-oss
for boot-cljs-repl (reference/foundation for this project)
slotkenov
for the original snippet that inspired this project