Skip to content

Instantly share code, notes, and snippets.

@yayitswei
Created January 11, 2013 12:01
Show Gist options
  • Select an option

  • Save yayitswei/4510207 to your computer and use it in GitHub Desktop.

Select an option

Save yayitswei/4510207 to your computer and use it in GitHub Desktop.
lein cljsbuild once runs slowly
(def cljs-files ["main" "template"])
(defn keyword-dasherize [& words]
(keyword (clojure.string/join "-" words)))
(defn name-to-build-opts [name]
{(keyword-dasherize name "dev")
{:source-path (str "src/cljs-" name)
:compiler
{:output-to (str "resources/public/js/bin-debug-" name "/" name ".js")
:output-dir (str "resources/public/js/bin-debug-" name)
:optimizations :whitespace
:pretty-print true}}
(keyword-dasherize name "prod")
{:source-path (str "src/cljs-" name)
:compiler
{:output-to (str "resources/public/js/bin/" name ".js")
:output-dir (str "resources/public/js/bin-" name)
:optimizations :whitespace
:pretty-print true}}})
(def build-opts (apply merge (map name-to-build-opts cljs-files)))
(defproject papyrus "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.4.0"]
[jayq "2.0.0"]
[cc.qbits/fetch "0.1.0-alpha2"]
[crate "0.2.3"]
[clj-aws-s3 "0.3.3"]
[clj-pdf "1.0.5"]
[noir "1.3.0-beta10"]]
:plugins [[lein-cljsbuild "0.2.10"]]
:cljsbuild {:builds ~build-opts}
:s3 {:bucket "papyrus-app"
:root "resources/public/"
:files ["js/bin/main.js" "js/bin/template.js"
"css/styles.css" "img/loading.gif"]}
:main papyrus.server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment