@@ -10,10 +10,16 @@ strongly advised to use `figwheel-main`.
10
10
11
11
== Using Figwheel-main
12
12
13
+ The setup instructions that follow focus on the bare minimum you need to do
14
+ to get Figwheel to work with CIDER. For more details you should check out
15
+ Figwheel's https://figwheel.org/docs/installation.html[excellent documentation].
16
+
13
17
=== Leiningen Setup
14
18
15
19
NOTE: This part of the setup is only necessary if `cider-inject-dependencies-at-jack-in` has
16
- been changed from its default setting of `enabled`, as described more fully above.
20
+ been changed from its default setting of `t` (enabled), as described earlier.
21
+ You'll also have to configure Piggieback manually if you're planning to use
22
+ `cider-connect-cljs`.
17
23
18
24
. Add this to your dev `:dependencies` (not needed for `cider-jack-in-cljs`):
19
25
+
@@ -29,6 +35,26 @@ been changed from its default setting of `enabled`, as described more fully abov
29
35
:nrepl-middleware [cider.piggieback/wrap-cljs-repl]
30
36
----
31
37
38
+ Now it's time to add `figwheel-main` to your dependencies as well and you're good to go. Here's
39
+ an example minimal `project.clj` (sans the optional Piggieback setup):
40
+
41
+ [source,clojure]
42
+ ----
43
+ (defproject example-project "0.1.0-SNAPSHOT"
44
+ :dependencies [[org.clojure/clojure "1.10.1"]]
45
+ :profiles
46
+ {:dev
47
+ {:dependencies [[org.clojure/clojurescript "1.10.339"]
48
+ [com.bhauman/figwheel-main "0.2.3"]]}})
49
+ ----
50
+
51
+ You can now verify that everything's properly setup by running:
52
+
53
+ $ lein run -m figwheel.main
54
+
55
+ A browser window should pop open and back in the terminal you should see a REPL
56
+ with a `cljs.user=>` prompt waiting to evaluate ClojureScript code.
57
+
32
58
=== Clojure CLI Setup
33
59
34
60
. Ensure your `deps.edn` contains these dependencies available from an
@@ -39,7 +65,7 @@ deps.edn.
39
65
+
40
66
[source,clojure]
41
67
----
42
- { :aliases {:fig {:extra-deps
68
+ {:aliases {:fig {:extra-deps
43
69
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
44
70
com.bhauman/figwheel-main {:mvn/version "0.2.3"}}}}}
45
71
----
@@ -83,6 +109,8 @@ using the `cider-figwheel-main-default-options`.
83
109
See https://github.com/bhauman/figwheel-main/blob/master/src/figwheel/main/api.clj[figwheel.main.api/start]
84
110
for details.
85
111
112
+ TIP: Figwheel's own documentation has a nice https://figwheel.org/docs/emacs.html[section, dedicated to CIDER].
113
+
86
114
== Using legacy Figwheel (Leiningen-only)
87
115
88
116
WARNING: This has been deprecated in favour of using `figwheel-main`. Check out
0 commit comments