                   ;; 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

                   (merge (build-once-opt cfg build-name)
                          {:args args})))

(defn repl-main-opt [repl-env-fn [_ & args] cfg]
  (default-compile
   repl-env-fn
   (-> cfg
       (assoc :args args)
       (update :options (fn [opt] (merge {:main 'figwheel.repl.preload} opt)))
       (assoc-in [:repl-env-options :open-url]
                 "http://[[server-hostname]]:[[server-port]]/?figwheel-server-force-default-index=true")
       ;; TODO :default-index-body should be a function that takes the build options as an arg
       (assoc-in [:repl-env-options :default-index-body] default-main-repl-index-body)
       (assoc-in [::config :mode] :repl)
       (assoc-in [::build] {:id "figwheel-default-repl-build"}))))

(declare serve update-config)


                                               false
                                               ansip/*use-color*)]
                   (ansip/format-str (log/format-ex except-data))))
        #_(clojure.pprint/pprint (Throwable->map err))
        (flush)))))

;; TODO this needs to work in nrepl as well
