Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cljs-watch cljs-src/ '{:optimizations :none :output-to "test.js"}'
* the default output-to is set to `resources/public/cljs/bootstrap.js`
* it will add the local `lib/` to your classpath when you run it, allowing you to have other cljs deps in that folder
* to add custom macros, you can use create a folder called `cljs-macros/` from the root directory and add your macros there. You can also put macros in `CLOJURESCRIPT_HOME/lib/` to have them globally available.
* `:optimizations` is set to `:simple` by default. you can disable any optimization by passing `:none` as the value.

## License

Expand Down
10 changes: 9 additions & 1 deletion src/cljs_watch/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,17 @@
(catch Exception e (println e))))]
{:source source :options options}))

(defn get-opts
[options]
(let [ret (merge default-opts options)]
;; Remove the :optimizations key if it's :none
(if (= (:optimizations ret) :none)
(dissoc ret :optimizations)
ret)))

(let [{:keys [source options]} (transform-cl-args *command-line-args*)
src-dir (or source "src/")
opts (merge default-opts options)]
opts (get-opts options)]
(.mkdirs (file (:output-dir opts)))
(watcher-print "Building ClojureScript files in ::" src-dir)
(compile-cljs src-dir opts)
Expand Down