Fork me on GitHub

Is it possible to define :open-url dynamically in figwheel configuration? I have this right now:

:open-url ""
I need the port to be configurable - sort of like [[server-port]] but not quite because the port here is the backend server port which is configured separately - by default, we use 5000, I use 5001, somebody else might use something different. Right now, I can only think of parsing the port number from the config (`profiles.clj`) and dynamically updating figwheel-main.edn before figwheel build is started.


The best thing I was able to come with was renaming my current figwheel-main.edn to figwheel-main.edn.template and create a script that will automatically generate figwheel-main.edn with proper port by reading it first from profiles.clj.


server_port=$(cat profiles.clj | bb '(get-in *input* [:profiles/dev :env :options :port])')
sed "s/\[\[server-port\]\]/${server_port}/" figwheel-main.edn.template > figwheel-main.edn


Figwheel main has a scripting interface too where you pass the configs as runtime maps instead of using files at all.


So that's another possible path