   (s/keys
     :req-un
     [::init-fn
-     ::shared/output-to]
+     ::shared/output-dir]
     ))
 
 (defmethod config/target-spec :react-native [_]

                '[cljs.user
                  shadow.cljs.devtools.client.react-native]))))))

(defn flush-dev-index [{::keys [output-file] :as state} {:keys [build-id init-fn] :as config}]
  (spit output-file
    (str "var CLJS = require(\"./cljs-dev/" (name build-id) "/cljs_env.js\");\n"
         (->> (:build-sources state)
              (remove #{output/goog-base-id})
              (map #(data/get-source-by-id state %))
              (map :output-name)
              (map #(str "require(\"./cljs-dev/" (name build-id) "/" % "\");" ))
              (str/join "\n"))
         "\nCLJS." (cljs-comp/munge init-fn) "();")))


      [:compiler-options :closure-defines 'shadow.cljs.devtools.client.env/server-host]
      (str server-addr))))

(defn configure [state mode {:keys [build-id init-fn output-dir] :as config}]
  (let [output-dir
        (io/file output-dir)

        output-file
        (io/file output-dir "index.js")

        dev?
        (= :dev mode)]

    (io/make-parents output-file)

    (-> state
        (build-api/with-build-options {:output-dir output-dir})
