                   ;; we need to get the server host:port args
                   (serve {:repl-env repl-env
                           :repl-options repl-options
-                          :eval-str (when fw-mode? (start-figwheel-code config))
                           :join? (get b-cfg ::join-server? true)}))))))))))
 
-(defn start [{:keys [figwheel-options build join-server?]}]
-  (let [[build-id build-options] (if (map? build)
-                                   [(:id build) (:options build)]
-                                   [build])
-        build-id (name (or build-id "dev"))
-        options  (or (and (not build-options)
-                          (get-build build-id))
-                     build-options
-                     {})
-        cfg
-        (cond-> {:options options
-                 ::join-server? (if (true? join-server?) true false)}
-          figwheel-options (assoc ::start-figwheel-options figwheel-options)
-          build-id    (assoc ::build {:id  build-id
-                                      :config (meta options)})
-          (not (get figwheel-options :mode))
-          (assoc-in [::config :mode] :repl))]
-    (default-compile cljs.repl.figwheel/repl-env cfg)))
+(defn start
+  ([] (start {}))
+  ([{:keys [figwheel-options build join-server?]}]
+   (let [[build-id build-options] (if (map? build)
+                                    [(:id build) (:options build)]
+                                    [build])
+         build-id (name (or build-id "dev"))
+         options  (or (and (not build-options)
+                           (get-build build-id))
+                      build-options
+                      {})
+         cfg
+         (cond-> {:options options
+                  ::join-server? (if (true? join-server?) true false)}
+           figwheel-options (assoc ::start-figwheel-options figwheel-options)
+           build-id    (assoc ::build {:id  build-id
+                                       :config (meta options)})
+           (not (get figwheel-options :mode))
+           (assoc-in [::config :mode] :repl))]
+     (default-compile cljs.repl.figwheel/repl-env cfg))))
 
 ;; ----------------------------------------------------------------------------
 ;; REPL api


(defn build [{:keys [watch-dirs mode ::build] :as config} options cenv]
  (let [source (when (and (= :none (:optimizations options :none)) (:main options))
                 (:uri (bapi/ns->location (symbol (:main options)))))]
    ;; TODO should probably try obtain a watch path from :main here
    ;; if watch-dirs is empty
    (if-let [paths (and (not= mode :build-once) (not-empty watch-dirs))]
      (do
        (build-cljs (:id build "dev") (apply bapi/inputs paths) options cenv)
        (watch-build (:id build "dev")
                     paths options cenv (select-keys config [:reload-clj-files])))
      (cond
        source
        (build-cljs (:id build "dev") source options cenv)
        ;; TODO need :compile-paths config param
        (not-empty watch-dirs)
        (build-cljs (:id build "dev") (apply bapi/inputs watch-dirs) options cenv)))))

(defn log-server-start [repl-env]
  (let [host (get-in repl-env [:ring-server-options :host] "localhost")

                                                ::start-figwheel-options
                                                config))
                (doseq [init-fn (::initializers b-cfg)] (init-fn))
                (figwheel.core/start*)
                (cond
                  (= mode :repl)
                  ;; this forwards command line args
