           (flush-module-data))
         (flush-manifest))))
 
-
-
 (defn make-web-worker-prepend [state mod]
   (let [all
         (get-all-module-deps state mod)

          out)]

    (io/make-parents target)
    (spit target out)))

(defn flush-unoptimized-module!
  [state module target]
  (if (= :eval (get-in state [:shadow.build/config :devtools :loader-mode]))
    (flush-unoptimized-module-eval! state module target)
    (flush-unoptimized-module-fetch! state module target)))

(defn flush-unoptimized!
  [{:keys [build-modules] :as state}]

  ;; FIXME: this always flushes

(def ^Escaper js-escaper
  (SourceCodeEscapers/javascriptEscaper))

(defn generate-eval-js-output [state {:keys [sources] :as mod}]
  (->> sources
       (remove #{output/goog-base-id})
       (reduce
         (fn [state src-id]
           (let [{:keys [output-name] :as rc} (data/get-source-by-id state src-id)
                 {:keys [js eval-js] :as output} (data/get-output! state rc)]
             (if eval-js
               state
               (let [source-map? (output/has-source-map? output)
                     eval-js (str "SHADOW_ENV.evalLoad(\"" output-name "\", " source-map? " , \"" (.escape js-escaper ^String js) "\");")]
                 (assoc-in state [:output src-id :eval-js] eval-js)))))
         state)))

(defn flush-unoptimized-module-eval
  [{:keys [unoptimizable] :as state}
   {:keys [goog-base prepend append sources web-worker] :as mod}
   target]

  (let [sources
