           (when-not (= mode :build-once)
             (cond
               (= mode :repl)
+              ;; this forwards command line args
               (repl repl-env repl-env-options (get-repl-options cfg))
               (or (= mode :serve) fw-mode?)
+              ;; we need to get the server host:port args
               (serve repl-env
-                     repl-env-options
+                     (update-server-host-port repl-env-options)
                      (get-repl-options cfg)
                      (when fw-mode? "(figwheel.core/start-from-repl)")))))))))
 

      (when-let [server @(:server renv)]
        (.join server)))))

;; TODO make this into a figwheel-start that
;; takes the correct config
;; and make an adapter function that produces the correct args for this fn

      (cond
        source
        (bapi/build source options cenv)
        ;; TODO need :compile-paths config param
        (not-empty watch-dirs)
        (bapi/build (apply bapi/inputs watch-dirs) options cenv)))))

