Last active
July 4, 2016 13:24
-
-
Save qwtel/1e8b0fe85aefc6773f94fc177554df55 to your computer and use it in GitHub Desktop.
Very basic ClojureScript Leiningen configuration: https://www.youtube.com/watch?v=eWGFYRyWT0Y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject hello-world "0.0.0" | |
;; lein obviously does dependency management | |
:dependencies [[org.clojure/clojure "1.8.0"] | |
[org.clojure/clojurescript "1.9.92"]] | |
;; and uses plugins for non-standard tasks | |
:plugins [[lein-cljsbuild "1.1.3"] | |
[lein-figwheel "0.5.4-4"]] | |
;; this will build cljs on `lein compile` | |
:hooks [leiningen.cljsbuild] | |
;; cljsbuild configuraiton | |
;; takes multimple builds (will execute in parallel) | |
;; choosing a name for a build allows to modify it in other profiles (see below) | |
:cljsbuild {:builds {:main {:source-paths ["src"] | |
:compiler {:main hello-world.core | |
:output-to "resources/public/js/main.js" | |
:output-dir "resources/public/js" | |
:asset-path "js"}}}} | |
;; I suggest using profiles from the beginning | |
;; `dev` profile is known to lein and enabled by default | |
:profiles {:dev {:cljsbuild {:builds {:main {:figwheel true | |
:compiler {:optimizations :none | |
:source-map true}}}}} | |
;; `prod` key is not known to lein, choose any you want | |
:prod {:cljsbuild {:builds {:main {:compiler {:optimizations :advanced | |
:pretty-print false}}}}}} | |
;; `resources/public/js` is a non-standard target folder, so we overwrite `clean-targets` | |
:clean-targets ^{:protect false} ["target" "resources/public/js"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment