  This is an annotated example of the  - cljsbuild options that
; may be set in a project.clj file. It is a fairly contrived example
; in order to cover all options exhaustively; it shouldn't be considered
; a representative configuration. For complete, working examples, look in
; the example-projects/ folder.

(defproject org.example/sample "1.0.0-SNAPSHOT"
  Your project must use Clojure 1.4 or above to support
  ; ClojureScript compilation.
  :dependencies [[org.clojure/clojure "1.7.0"]
                 ; Your project should specify its own dependency on
                 ; ClojureScript
                 [org.clojure/clojurescript "1.7.170"
                  :exclusions [org.apache.ant/ant]]]
  Your project should plugin - depend on    , to ensure that
  ; the right version of the plugin is installed.
  :plugins [[lein-cljsbuild "1.1.1"]]
  The standard Leiningen : source - paths option is used by   
  ; to determine the source directory from which crossover files will
  be copied .   Leiningen defaults to [ " src " ] .
  :source-paths ["src-clj"]
  This is required for  - cljsbuild to hook into the default Leningen
  tasks , e.g. the " lein compile " and "  jar " tasks .
  :hooks [leiningen.cljsbuild]
  All lein - cljsbuild - specific configuration is under the :  key .
  :cljsbuild {
    ; When using a ClojureScript REPL, this option controls what port
  it listens on for a browser to connect to .   Defaults to 9000 .
    :repl-listen-port 9000
    ; The keys in this map identify repl-launch commands.  The values are
  sequences representing shell commands like [ command , arg1 ,  , ... ] .
    ; Defaults to the empty map.
    :repl-launch-commands
      {"firefox" ["firefox"]
       "firefox-naked" ["firefox" "resources/public/html/naked.html"]
       "phantom" ["phantomjs" "phantom/page-repl.js"]
       ; If a keyword appears in the command vector, it and all following
       ; entries will be treated as an option map.  Currently, the only
       ; supported options are :stdout and :stderr, which allow you to
       ; redirect the command's output to files.
       "phantom-naked" ["phantomjs"
                        "phantom/page-repl.js"
                        "resources/public/html/naked.html"
                        :stdout ".repl-phantom-naked-out"
                        :stderr ".repl-phantom-naked-err"]}
    ; The keys in this map identify test commands.  The values are sequences
  representing shell commands like [ command , arg1 ,  , ... ] .   Note that
    ; the :stdout and :stderr options work here as well.
    ; Defaults to the empty map.
    :test-commands
      {"unit" ["phantomjs" "phantom/unit-test.js" "resources/private/html/unit-test.html"]}
  A list of namespaces that should be copied from the Clojure classpath into
    ; the :crossover-path, with some changes for ClojureScript compatibility. See
    ; doc/CROSSOVERS.md for more details. Defaults to the empty vector [].
    :crossovers [example.crossover]
    ; The directory into which the :crossovers namespaces should be copied.
    ; Defaults to "target/cljsbuild-crossover".
    :crossover-path "target/my-crossovers"
    ; If hooks are enabled, this flag determines whether files from :crossover-path
  are added to the JAR file created by "  jar " .
    :crossover-jar true
    ; The :builds option should be set to a sequence of maps.  Each
    ; map will be treated as a separate, independent, ClojureScript
    ; compiler configuration.
    :builds {
      :main {
  The paths under which    will look for ClojureScript
        ; files to compile.  Defaults to ["src-cljs"].
        :source-paths ["src-cljs"]
        ; If hooks are enabled, this flag determines whether files from these
  : source - paths are added to the JAR file created by "  jar " .
        :jar true
        ; If a notify-command is specified, it will be called when compilation succeeds
        ; or fails, and a textual description of what happened will be appended as the
        ; last argument to the command.  If a more complex command needs to be constructed,
        ; the recommendation is to write a small shell script wrapper.
        ; Defaults to nil (disabled).
        :notify-command ["growlnotify" "-m"]
  Determines whether the temporary JavaScript files will be left in place between
        ; automatic builds.  Leaving them in place speeds up compilation because things can
        ; be built incrementally.  This probably shouldn't be disabled except for troubleshooting.
        ; Defaults to true.
        :incremental true
  Determines whether assertions are enabled for the ClojureScript code .   Technically , this
  binds clojure.core/*assert * , which is respected by the ClojureScript compiler .
        ; Defaults to true.
        :assert true
  The : compiler options are passed directly to the ClojureScript compiler .
        :compiler {
  The path to the JavaScript file that will be output .
          ; Defaults to "target/cljsbuild-main.js".
          :output-to "resources/public/js/main.js"
          ; This flag will turn on compiler warnings for references to
          ; undeclared vars, wrong function call arities, etc. Defaults to true.
          :warnings true
  The optimization level .   May be : none , : whitespace , : simple , or : advanced .
          ; :none is the recommended setting for development, while :advanced is the
          ; recommended setting for production, unless something prevents it (incompatible
          ; external library, bug, etc.).
          ; :none requires manual code loading and hence a separate HTML from the other options.
          ; Defaults to :none.
          :optimizations :whitespace
          ; This flag will cause all (assert x) calls to be removed during compilation
          ; Useful for production. Default is always false even in advanced compilation.
  Does NOT specify goog.asserts . ENABLE_ASSERTS which is different and used by
          ; the closure library.
          :elide-asserts true
  Determines whether the JavaScript output will be tabulated in
          ; a human-readable manner.  Defaults to true.
          :pretty-print true
  Determines whether comments will be output in the JavaScript that
          ; can be used to determine the original source of the compiled code.
          ; Defaults to false.
          :print-input-delimiter false
          ; If targeting nodejs add this line. Takes no other options at the moment.
          :target :nodejs
          ; See
          ; -maps
          :source-map "resources/public/js/main.js.map"
          ; Sets the output directory for temporary files used during
          ; compilation.  Must be unique among all :builds. Defaults to
          ; "target/cljsbuild-compiler-X" (where X is a unique integer).
          :output-dir "target/my-compiler-output-"
  Wrap the JavaScript output in ( function ( ) { ... } ;) ( ) to avoid clobbering globals .
          ; Defaults to true when using advanced compilation, false otherwise.
          :output-wrapper false
          ; Configure externs files for external libraries.
          ; Defaults to the empty vector [].
          ; For this entry, and those below, you can find a very good explanation at:
          ;     -javascript-and-clojurescript.html
          :externs ["jquery-externs.js"]
          ; Adds dependencies on external libraries.  Note that files in these directories will be
          ; watched and a rebuild will occur if they are modified.
          ; Defaults to the empty vector [].
          :libs ["closure/library/third_party/closure"]
          ; Adds dependencies on foreign libraries. Be sure that the url returns a HTTP Code 200
          ; Defaults to the empty vector [].
          :foreign-libs [{:file ""
                           :provides  ["my.example"]}]
          ; Prepends the contents of the given files to each output file.
          ; Defaults to the empty vector [].
          :preamble ["license.js"]
          ; Configure the input and output languages for the closure library.
  May be :  ,  , or  - strict .
  Defaults to  .
          :language-in :ecmascript5
          :language-out :ecmascript5
          ; Configure warnings generated by the Closure compiler.
          :closure-warnings {:externs-validation :off}}}}})

 may be set in a project.clj file. It is a fairly contrived example
 in order to cover all options exhaustively; it shouldn't be considered
 a representative configuration. For complete, working examples, look in
 the example-projects/ folder.
 ClojureScript compilation.
 Your project should specify its own dependency on
 ClojureScript
 the right version of the plugin is installed.
 to determine the source directory from which crossover files will
 When using a ClojureScript REPL, this option controls what port
 The keys in this map identify repl-launch commands.  The values are
 Defaults to the empty map.
 If a keyword appears in the command vector, it and all following
 entries will be treated as an option map.  Currently, the only
 supported options are :stdout and :stderr, which allow you to
 redirect the command's output to files.
 The keys in this map identify test commands.  The values are sequences
 the :stdout and :stderr options work here as well.
 Defaults to the empty map.
 the :crossover-path, with some changes for ClojureScript compatibility. See
 doc/CROSSOVERS.md for more details. Defaults to the empty vector [].
 The directory into which the :crossovers namespaces should be copied.
 Defaults to "target/cljsbuild-crossover".
 If hooks are enabled, this flag determines whether files from :crossover-path
 The :builds option should be set to a sequence of maps.  Each
 map will be treated as a separate, independent, ClojureScript
 compiler configuration.
 files to compile.  Defaults to ["src-cljs"].
 If hooks are enabled, this flag determines whether files from these
 If a notify-command is specified, it will be called when compilation succeeds
 or fails, and a textual description of what happened will be appended as the
 last argument to the command.  If a more complex command needs to be constructed,
 the recommendation is to write a small shell script wrapper.
 Defaults to nil (disabled).
 automatic builds.  Leaving them in place speeds up compilation because things can
 be built incrementally.  This probably shouldn't be disabled except for troubleshooting.
 Defaults to true.
 Defaults to true.
 Defaults to "target/cljsbuild-main.js".
 This flag will turn on compiler warnings for references to
 undeclared vars, wrong function call arities, etc. Defaults to true.
 :none is the recommended setting for development, while :advanced is the
 recommended setting for production, unless something prevents it (incompatible
 external library, bug, etc.).
 :none requires manual code loading and hence a separate HTML from the other options.
 Defaults to :none.
 This flag will cause all (assert x) calls to be removed during compilation
 Useful for production. Default is always false even in advanced compilation.
 the closure library.
 a human-readable manner.  Defaults to true.
 can be used to determine the original source of the compiled code.
 Defaults to false.
 If targeting nodejs add this line. Takes no other options at the moment.
 See
 -maps
 Sets the output directory for temporary files used during
 compilation.  Must be unique among all :builds. Defaults to
 "target/cljsbuild-compiler-X" (where X is a unique integer).
) ( ) to avoid clobbering globals .
 Defaults to true when using advanced compilation, false otherwise.
 Configure externs files for external libraries.
 Defaults to the empty vector [].
 For this entry, and those below, you can find a very good explanation at:
     -javascript-and-clojurescript.html
 Adds dependencies on external libraries.  Note that files in these directories will be
 watched and a rebuild will occur if they are modified.
 Defaults to the empty vector [].
 Adds dependencies on foreign libraries. Be sure that the url returns a HTTP Code 200
 Defaults to the empty vector [].
 Prepends the contents of the given files to each output file.
 Defaults to the empty vector [].
 Configure the input and output languages for the closure library.
 Configure warnings generated by the Closure compiler.
  This is an annotated example of the  - cljsbuild options that

(defproject org.example/sample "1.0.0-SNAPSHOT"
  Your project must use Clojure 1.4 or above to support
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/clojurescript "1.7.170"
                  :exclusions [org.apache.ant/ant]]]
  Your project should plugin - depend on    , to ensure that
  :plugins [[lein-cljsbuild "1.1.1"]]
  The standard Leiningen : source - paths option is used by   
  be copied .   Leiningen defaults to [ " src " ] .
  :source-paths ["src-clj"]
  This is required for  - cljsbuild to hook into the default Leningen
  tasks , e.g. the " lein compile " and "  jar " tasks .
  :hooks [leiningen.cljsbuild]
  All lein - cljsbuild - specific configuration is under the :  key .
  :cljsbuild {
  it listens on for a browser to connect to .   Defaults to 9000 .
    :repl-listen-port 9000
  sequences representing shell commands like [ command , arg1 ,  , ... ] .
    :repl-launch-commands
      {"firefox" ["firefox"]
       "firefox-naked" ["firefox" "resources/public/html/naked.html"]
       "phantom" ["phantomjs" "phantom/page-repl.js"]
       "phantom-naked" ["phantomjs"
                        "phantom/page-repl.js"
                        "resources/public/html/naked.html"
                        :stdout ".repl-phantom-naked-out"
                        :stderr ".repl-phantom-naked-err"]}
  representing shell commands like [ command , arg1 ,  , ... ] .   Note that
    :test-commands
      {"unit" ["phantomjs" "phantom/unit-test.js" "resources/private/html/unit-test.html"]}
  A list of namespaces that should be copied from the Clojure classpath into
    :crossovers [example.crossover]
    :crossover-path "target/my-crossovers"
  are added to the JAR file created by "  jar " .
    :crossover-jar true
    :builds {
      :main {
  The paths under which    will look for ClojureScript
        :source-paths ["src-cljs"]
  : source - paths are added to the JAR file created by "  jar " .
        :jar true
        :notify-command ["growlnotify" "-m"]
  Determines whether the temporary JavaScript files will be left in place between
        :incremental true
  Determines whether assertions are enabled for the ClojureScript code .   Technically , this
  binds clojure.core/*assert * , which is respected by the ClojureScript compiler .
        :assert true
  The : compiler options are passed directly to the ClojureScript compiler .
        :compiler {
  The path to the JavaScript file that will be output .
          :output-to "resources/public/js/main.js"
          :warnings true
  The optimization level .   May be : none , : whitespace , : simple , or : advanced .
          :optimizations :whitespace
  Does NOT specify goog.asserts . ENABLE_ASSERTS which is different and used by
          :elide-asserts true
  Determines whether the JavaScript output will be tabulated in
          :pretty-print true
  Determines whether comments will be output in the JavaScript that
          :print-input-delimiter false
          :target :nodejs
          :source-map "resources/public/js/main.js.map"
          :output-dir "target/my-compiler-output-"
          :output-wrapper false
          :externs ["jquery-externs.js"]
          :libs ["closure/library/third_party/closure"]
          :foreign-libs [{:file ""
                           :provides  ["my.example"]}]
          :preamble ["license.js"]
  May be :  ,  , or  - strict .
  Defaults to  .
          :language-in :ecmascript5
          :language-out :ecmascript5
          :closure-warnings {:externs-validation :off}}}}})
