Search code examples
javascriptclojureclojurescript

How to compile clojurescript to javascript?


enter image description here

I have a big question to authors of clojurescript. And to all clojurescript community.

ClojureScript tutorial is unefficient and broken. It doesn't help with this problem. (see picture)

How to compile clojurescript to javascript?


Solution

  • Using lein-mies template

    →  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.
    

    Now open index.html and see in browser console:

    Hello world!