Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:1392881
Created Nov 25, 2011

;; buildjs.clj
(require '[cljs.closure :as cljsc])
(def src-folder "<a folder with *.cljs files>")
(def out-folder "<an output folder path>")
(defn buildjs [file optimizations]
(cljsc/build (str src-folder file ".cljs")
{:optimizations optimizations
;; a good explanation of externs is here: http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
;; :externs ["<path to externs file>"]
:output-dir out-folder
:output-to (str out-folder file ".js")}))
;; optimization may be :advanced, :whitespace and :simple
(buildjs "script" :simple)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment