Figwheel Main With Cursive
1:根目录下添加dev.cljs.edn
里面的内容:
{:main cljs-study.core}
其中cljs-study是工程名
2:修改project.clj
添加:
:profiles
{:dev
{:dependencies [[org.clojure/clojurescript "1.10.773"]
[com.bhauman/figwheel-main "0.2.16"]
;; optional but recommended
[com.bhauman/rebel-readline-cljs "0.1.4"]]
:resource-paths ["target"]
:clean-targets ^{:protect false} ["target"]}}
:aliases {"fig" ["trampoline" "run" "-m" "figwheel.main"]}
3:新建目录dev
先确保能运行
lein fig -- -b dev -r
然后根目录下新建目录de,添加文件user.clj,里面内容:
(require '[figwheel.main.api :as fig])
(fig/start "dev")
4:修改run-config
project.clj上右键,选择More Run/Debug。
然后which type of REPL to run选择clojure.main
Common Opinions里面的Parameters填写dev/user.clj。
好了,在project.clj上面可以运行REPL for XXX了,然后右侧的repl就是clojure script的了。