             (swap! file-md5-atom assoc filepath check-sum)
             changed?))))))
 
+(defn target-file-changed? [{:keys [file-md5-atom] :as st} ns-sym]
+  (let [file (cbapi/cljs-target-file-from-ns (:output-dir st) ns-sym)
+        filepath (str file)]
+    (when (.exists file)
+      (let [check-sum (digest/md5 file)
+            changed? (not= (get @file-md5-atom filepath)
+                           check-sum)]
+        (swap! file-md5-atom assoc filepath check-sum)
+        changed?))))
+
 (defn dependency-files [{:keys [output-to output-dir]}]
    [output-to (str output-dir "/goog/deps.js") (str output-dir "/cljs_deps.js")])
 

        :eval-body (slurp %)})
   (dependency-files st)))

(defn make-sendable-file
  "Formats a namespace into a map that is ready to be sent to the client."
  [st nm]
  (let [n (-> nm name underscore)]
    { :file (str (cbapi/cljs-target-file-from-ns (:output-dir st) nm))
      :namespace (cljs.compiler/munge n)
      :type :namespace
      :meta-data (meta nm) }))

;; I would love to just check the compiled javascript files to see if
;; they changed and then just send them to the browser. There is a

   [watchtower.core :as wt :refer [watcher compile-watcher watcher* ignore-dotfiles file-filter extensions]]
   [clojure.core.async :refer [go-loop <!! <! chan put! sliding-buffer timeout]]
   [clojure.string :as string]
   [clojure.set :refer [difference union]]
   [clojure.edn :as edn]
   [clojure.java.io :refer [as-file] :as io]
   [digest]
