參考文檔:Running figwheel in a Cursive Clojure REPL
1、最好先使用lein模板創(chuàng)建:lein new figwheel hello-world
.
2、在根目錄創(chuàng)建: script/repl.clj
,內(nèi)容如下:
(use 'figwheel-sidecar.repl-api)
(start-figwheel! {:all-builds (figwheel-sidecar.repl/get-project-cljs-builds)})
(cljs-repl)
3、
Click Run->Edit configurations.
Click the +
button at the top left and choose Clojure REPL
Enter a name in the Name field (e.g. "REPL")
Choose the radio button Use clojure.main in normal JVM process
In the Parameters field put script/repl.clj
Click the OK button to save your REPL config.
大致如圖所示:
Paste_Image.png
4、執(zhí)行 run->run script即可。在瀏覽器上打開 http://localhost:3449/
,就可以連接repl了。
注意:如果出現(xiàn)修改源代碼沒有自動通知到瀏覽器,或者出現(xiàn)404錯誤,那么在repl中執(zhí)行 (reset-autobuild)
即可。