Skip to content

Instantly share code, notes, and snippets.

@ericnormand
Last active September 16, 2015 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericnormand/25479189841f179e2766 to your computer and use it in GitHub Desktop.
Save ericnormand/25479189841f179e2766 to your computer and use it in GitHub Desktop.

Boot

Boot is another build tool for Clojure. If you're using it, there is a ClojureScript build task called boot-cljs.

In your boot.boot file, add this dependency (check Clojars for the latest version):

:dependencies [...
               [adzerk/boot-cljs "1.7.48-3"]
               ...]

And this source path:

:source-paths #{... "cljs-src" ...}

Add this requires:

(require '[adzerk.boot-cljs :refer [cljs]])

Then create a file called cljs-src/out/main.cljs.edn and put this in there:

{:require [foo.core]}

Replace foo.core with the main namespace of your application. Typically, the ClojureScript compiler would read in all of the .cljs files in your source directory. But Boot adds a way to restrict what gets compiled.

Then run:

> boot cljs -O advanced

That will compile your code and output it to out/main.js

If you already have a build task scripted up, you can add the cljs task to it to have your ClojureScript compiled for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment