2014-11-24 141 views
-5

enter image description here如何编译clojurescript到JavaScript?

我对clojurescript的作者有一个很大的问题。对所有clojurescript社区。

ClojureScript教程效率不高,破损。这对这个问题没有帮助。 (见图)

如何编译clojurescript到JavaScript?

+1

添加一个链接,你正在使用 – edbond 2014-11-24 17:44:28

+3

这个问题教程,如上所述,是不是一个很好的一个。哪个教程?你采取了哪些步骤来获取堆栈跟踪?这就是说,我完全同情挫折。我最终发现了一个clojurescript例程,对我来说工作正常,但花了相当长的一段时间和大量的试验和错误。几乎,但并不是所有我能找到的clojurescript资源都像泥巴一样有帮助。 – galdre 2014-11-24 18:05:03

+0

看起来教程是https://github.com/clojures/clojurescript/wiki/Quick-Start#using-clojurescript-on-a-web-page – edbond 2014-11-24 18:52:39

回答

1

使用lein-mies模板

→ lein new mies hello-world 
Retrieving mies/lein-template/0.4.1/lein-template-0.4.1.pom from clojars 
Retrieving mies/lein-template/0.4.1/lein-template-0.4.1.jar from clojars 
→ cd hello-world 
→ lein cljsbuild auto 
Compiling ClojureScript. 
Compiling "hello_world.js" from ["src"]... 
Successfully compiled "hello_world.js" in 8.025 seconds. 

现在打开index.html并查看浏览器控制台:

Hello world!