     (build-fn
      (assoc build-state
             :build-config (add-connect-script! figwheel-server build-config)))
+    ;; this will probably not be needed sometime in the future but for
+    ;; now it is safer to let goog.base to do all the loading in an HTML
+    ;; environment before figwheel gets loaded
     (append-connection-init! build-config)))


(defn- has-output-to? [build]
  (get-in build [:build-options :output-to]))

#_(defn- modules-output-to [build]
  (when (get-in build [:build-options :modules])
    (get-in build [:build-options :modules :cljs-base :output-to]
            (str (io/file (get-in build [:build-options :output-dir]
                                  "out") "cljs_base.js" )))))

#_(defn- build-output-to [build]
  (or (modules-output-to build)
      (get-in build [:build-options :output-to])))


#_(build-output-to {:build-options {:output-to "resources/public/asdf.js"
                                  :output-dir "resources/public/js"
                                  :modules {:cljs-base {:output-to "baser.js"}}}})


(defn add-connect-script! [figwheel-server build]
  ;; cannot just supply arbitrary connection code to the compiler because of the following issues

                                                   bo)))))
    build))

;; continuing to append require for the html document case to enable
;; document.onload callbacks to work
(defn esc-fmt [a & args]
  (apply format a (map pr-str args)))

(defn document-write-src-script [src]
  (esc-fmt "\ndocument.write(%s);"
