Skip to content

Configuration Options

Alan Thompson edited this page Mar 15, 2019 · 4 revisions

Configurations happens in your project.clj file and is separated into serverside configs (:figwheel {...} on your "root" level) and per-build, or client side, configs (:cljsbuild {:builds [{:figwheel {...}}]}).

Server:

  • :server-ip "127.0.0.1": Interface to listen on. Default: localhost

  • :server-port 3449: Port to listen on. Default: 3449

  • :server-logfile "tmp/logs/figwheel-logfile.log": Location of the log file. Default: figwheel_server.log

  • :http-server-root "public": Directory under resources, that will be served. Default: public

  • :css-dirs ["resources/public/css"]: Directory to watch for changes to CSS files, that will be sent to the browser. Default: none

  • :reload-clj-files {:clj true :cljc false}: Clojure Macro reloading. Disable reloading by suffix. false just disables .clj. Default: Off

  • :ring-handler hello_world.server/handler: If you want to embed a ring handler into the figwheel http-kit server; this is for simple ring servers, if this doesn't work for you just run your own server. Default: Off

  • :open-file-command "myfile-opener" To be able to open files in your editor from the heads up display you will need to put a script on your path. That script will have to take a file path and a line number ie. in ~/bin/myfile-opener:

    #! /bin/sh
    emacsclient -n +$2 $1
    

    Default: Off

  • :repl false: Run a repl? Default: true

  • :nrepl-port 7888: Start a nREPL server into the running figwheel process. Default: Off

  • :nrepl-middleware ["cider.nrepl/cider-middleware" "cider.piggieback/wrap-cljs-repl"]: Middleware to load with the nREPL. Default: none

  • :cljs-build-fn your-ns/your-fn (advanced!) Supply a custom build function. The default is figwheel-sidecar.components.cljs-autobuild/figwheel-build. You can "wrap" this function to perform actions at the start/end of a build. The argument can be either a fully qualified symbol or a function.

Client:

  • :websocket-host :js-client-host: Configure a websocket host. Figwheel already knows the port. This is helpful if you want to broadcast to devices. If you set it to :js-client-host, it will set the host based on the js/location.host param of the browser. This is helpful for multiple device settings where you are using fighweel to serve your app. Default: localhost

  • :on-jsload "example.core/fig-reload": Call this function on each figwheel refresh. Default: Off

  • :autoload false: If you want to do REPL based development and not have compiled files autoloaded into the client env. Default: true

  • :heads-up-display false: Show a notification in the browser on each refresh. Default: true

  • :load-warninged-code true If there are warnings in your code emitted from the compiler, figwheel does not refresh. Default: false