配置ClojureScript环境(Cursive)

2015-09-19  本文已影响383人  业翔

参考文档:Running figwheel in a Cursive Clojure REPL

1、最好先使用lein模板创建:lein new figwheel hello-world.
2、在根目录创建: script/repl.clj,内容如下:

(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、执行 run->run script即可。在浏览器上打开 http://localhost:3449/,就可以连接repl了。

注意:如果出现修改源代码没有自动通知到浏览器,或者出现404错误,那么在repl中执行 (reset-autobuild)即可。

上一篇下一篇

猜你喜欢

热点阅读