Skip to content

Commit

Permalink
Merge pull request #211 from cemerick/master
Browse files Browse the repository at this point in the history
only reload Clojure source files that define macros (fixes gh-210)
  • Loading branch information
cemerick committed Aug 30, 2013
2 parents 54f564b + 1da7e27 commit f86627c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion support/src/cljsbuild/compiler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[cljs.analyzer :as analyzer]
[cljs.closure :as closure]
[clojure.string :as string]
[clojure.java.io :as io]
[fs.core :as fs]))

(def reset-color "\u001b[0m")
Expand Down Expand Up @@ -95,7 +96,13 @@
; not affect any cljs file mtimes, we have to clear the cache here to force everything
; to be rebuilt.
(fs/delete-dir (:output-dir compiler-options))
(doseq [path paths]
(doseq [path paths
; only Clojure files that define macros can possibly affect
; ClojureScript compilation; those that don't might define the "same"
; namespace as a same-named ClojureScript file, and thus interfere
; with cljsc's usage of Clojure namespaces during compilation. gh-210
:when (-> path (string/replace #"^/" "") io/resource
^String slurp (.contains "defmacro"))]
(try
(load (drop-extension path))
(catch Throwable e
Expand Down

0 comments on commit f86627c

Please sign in to comment.