    [clojure.walk :as walk]
    [cljs.env]))
 
+(defn get-build-options [build]
+   (or (:build-options build) (:compiler build) {}))
+
 (defn mkdirs [fpath]
   (let [f (io/file fpath)]
     (when-let [dir (.getParentFile f)] (.mkdirs dir))))
-
-(defn get-build-options [build]
-   (or (:build-options build) (:compiler build) {}))
-
-(defn optimizations-none?
-  "Given a map of compiler options returns true if a build will be
-  compiled in :optimizations :none mode"
-  [{:keys [optimizations]}]
-  (or (nil? optimizations) (= optimizations :none)))
 
 ;; TODO compiler probably handles this now
 (defn ensure-output-dirs!

    (assoc-in build [:build-options :devcards] true)
    build))

(defn prep-build-for-figwheel-client
  "Given a build config that has a :figwheel config in it "
  [{:keys [id figwheel] :as build}]
  (if figwheel
    (assoc build :figwheel
           (-> (if (map? figwheel) figwheel {})
               (append-build-id id)
               fix-symbol-vals))
    build))

(defn figwheel-build? [{:keys [build-options] :as build}]


(defn fix-build-options [build-options]
  (->> build-options
       default-optimizations-to-none
       (apply-to-key normalize-dir :output-dir)
       sane-output-to-dir))

(defn move-compiler-to-build-options [build]
  (-> build
