Fork me on GitHub

once you are done with the development... how does one actually release the figwheel build for production? What is the process?


Figwheel is a dev-only tool. It sits on top of cljs.main to add dev convience.


So the process to build for production is to just use cljs.main. This is how I do it:


clojure -M --main cljs.main --compile-opts common.cljs.edn --compile-opts min.cljs.edn --compile-opts prod-server-config.edn --compile


Thanks I'll give it a try


Is there an example for the contents of all the edn files you are using? Many thanks again


Ok Figwheel build with dev settings works. When built with advanced setting... however the script doesn't work atall!! Why is this? I merely included the dev-main.js in the html and opened the html in browser... I am sure I am being an idiot... any help will be greatly appreciated.


Javascript interop doesn’t always work very well with advanced compilation. To make it easier to track down, you can add :pseudo-names true to your config. Generally what has happened is that the CLJS compiler has renamed some interop call, not understanding that it was an interop call. One way to deal with these situations is to typehint the JS object with ^js; however, I have personally run into some kind of small, reproducible bug where this was not entirely reliable. The most reliable method I know of is on the cljs website:

(let [yay ((goog.object.get js/window "yayQuery"))]
  ((goog.object.get yay "sayHello") ((goog.object.get yay "getMessage"))))
However, I recommend tweaking this for full generalizability — you bind the fn back to the object you pulled it off of for it to work. Have fun!

👍 2