Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 98 lines (97 sloc) 5.324 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
; This is an annotated example of the lein-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.3 or above to support
  ; ClojureScript compilation.
  :dependencies [[org.clojure/clojure "1.3.0"]]
  ; Your project should plugin-depend on lein-cljsbuild, to ensure that
  ; the right version of the plugin is installed.
  :plugins [[lein-cljsbuild "0.1.2"]]
  ; The standard Leiningen :source-path option is used by lein-cljsbuild
  ; to determine the source directory from which crossover files will
  ; be copied. Leiningen defaults to "src".
  :source-path "src-clj"
  ; This is required for lein-cljsbuild to hook into the default Leningen
  ; tasks, e.g. the "lein compile", "lein clean", and "lein jar" tasks.
  :hooks [leiningen.cljsbuild]
  ; All lein-cljsbuild-specific configuration is under the :cljsbuild 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, arg2, ...].
    ; 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, arg2, ...]. 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 "crossover-cljs".
    :crossover-path "crossover-cljs"
    ; If hooks are enabled, this flag determines whether files from :crossover-path
    ; are added to the JAR file created by "lein 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 [{
      ; The path under which lein-cljsbuild will look for ClojureScript
      ; files to compile. Defaults to "src-cljs".
      :source-path "src-cljs"
      ; If hooks are enabled, this flag determines whether files from this
      ; :source-path are added to the JAR file created by "lein jar".
      :jar true
      ; The :compiler options are passed directly to the ClojureScript compiler.
      :compiler {
        ; The path to the JavaScript file that will be output.
        ; Defaults to "main.js".
        :output-to "resources/public/js/main.js"
        ; The optimization level. May be :whitespace, :simple, or :advanced.
        ; Defaults to :whitespace.
        :optimizations :whitespace
        ; 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
        ; Sets the output directory for temporary files used during
        ; compilation. Must be unique among all :builds. Defaults to
        ; ".lein-cljsbuild-compiler-X" (where X is a unique integer).
        :output-dir ".clojurescript-output"
        ; 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:
        ; http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
        :externs ["jquery-externs.js"]
        ; Adds dependencies on external libraries.
        ; Defaults to the empty vector [].
        :libs ["closure/library/third_party/closure"]
        ; Adds dependencies on foreign libraries.
        ; Defaults to the empty vector [].
        :foreign-libs [[{:file "http://example.com/remote.js"
                         :provides ["my.example"]}]]}}]})
Something went wrong with that request. Please try again.