Skip to content

Instantly share code, notes, and snippets.

Created November 25, 2011 05:40
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 anonymous/1392881 to your computer and use it in GitHub Desktop.
Save anonymous/1392881 to your computer and use it in GitHub Desktop.
;; 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