Skip to content

Using a Git Checkout of the ClojureScript Compiler

greggaree edited this page Oct 12, 2013 · 5 revisions

To use an arbitrary version of the ClojureScript compiler with lein-cljsbuild, create a folder in your project dir, for example comp/. Inside this folder, clone the compiler:

$ cd comp && git clone git://github.com/clojure/clojurescript.git

If you already have a checkout of the compiler, you could create a symlink instead:

$ cd comp && ln -s ../../path/to/clojurescript clojurescript

Either way, once you have the checkout setup, you need to configure Leiningen to put it on the classpath.

Leiningen 2.x

Add the necessary clojurescript source directories to the classpath via :source-paths. Make sure that it includes your regular Clojure source path as well, if your project uses Clojure as well as ClojureScript:

(defproject example "0.0.0"
  {:source-paths
    ["src"
     "comp/clojurescript/src/clj"
     "comp/clojurescript/src/cljs"]}})

For more recent clojurescript compilers, you'll also need tools.reader as a dependency.

When running lein-cljsbuild with these modifications to your project file, lein-cljsbuild may emit the following message:

 WARNING: It appears your project does not contain a ClojureScript dependency. One will be provided
 for you by lein-cljsbuild, but it is strongly recommended that you add your own...

Disregard this warning.