我对clojurescript的作者提出了一个很大的问题。以及所有clojurescript社区。 p>
ClojureScript教程效率低下且破损。它对这个问题没有帮助。 (见图)
如何将clojurescript编译为javascript?
答案 0 :(得分: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!
答案 1 :(得分:0)
这个问题很旧。我在Google上看到了。自2017年以来,现在我们有了更好的解决方案来编译ClojureScript。shadow-cljs具有更好的编译体验,例如Webpack,您可以阅读我收集的教程。
并在http://shadow-cljs.org中找到更多详细信息。