         source   (when (and (= :none (:optimizations opts :none)) main-ns)
                    (:uri (bapi/ns->location main-ns)))
         cenv     (cljs.env/default-compiler-env)]
-
+    (assert (not (:watch opts)))
+    (assert (not (:watch (:options cfg))))
     (cljs.env/with-compiler-env cenv
-      (if-let [path (:watch opts)]
+      (if-let [paths (and (not build-once?)
+                          (not-empty watch-dirs))]
         (do
-          (bapi/build (if (coll? path)
-                        (apply bapi/inputs path)
-                        path)
-                      (dissoc opts :watch)
-                      cenv)
-          (watch path
-                 (dissoc opts :watch)
-                 cenv))
+          (bapi/build (apply bapi/inputs paths) opts cenv)
+          (watch paths opts cenv))
         (bapi/build source opts cenv))
-      (when repl?
+      (when (and repl?
+                 (not build-once?) (not serve?))
         (#'cli/repl-opt repl-env args cfg))
-      (when (or serve? figwheel-mode?)
+      (when (and (not build-once?) (or serve? figwheel-mode?))
         ;; what to do when the repl isn't a figwheel repl here?
         ;; in the case where it isn't the repl we will need to start the server
         ;; directly, so perhaps start the server directly regardless

        (ex-info
          (str "Watch path " path " does not exist")
          {:cljs.main/error :invalid-arg}))))
  (update-in cfg [:options :watch] (fnil conj []) path))

(defn figwheel-opt [cfg bl]
  (assoc-in cfg [::options-meta :figwheel] (not= bl "false")))

(defn build-opt [cfg bn]
  (assoc-in cfg [::options-meta :build-name] bn))

(def figwheel-commands
  {:init {["-w" "--watch"]

                     (when main-ns
                       {:main main-ns})) opts
                   (cond-> opts
                     (:watch opts)
                     (dissoc opts :watch)

                     (not (:output-to opts))
                     (assoc :output-to default-output-to)

                     (and (not (:asset-path opts)) (figure-default-asset-path env-opts opts))
                     (assoc :asset-path (figure-default-asset-path env-opts opts))

                     (not (:output-dir opts))
                     (assoc :output-dir default-output-dir)

                     figwheel-mode?
                     (update :preloads
                             (fn [p]
                               (vec (distinct
                                     (concat p '[figwheel.repl.preload figwheel.core])))))

                     (not (contains? opts :aot-cache))
                     (assoc :aot-cache false)))
        convey   (into [:output-dir :output-to] cljs.repl/known-repl-opts)
