Fork me on GitHub
#figwheel-main
<
2021-07-21
>
ChillPillzKillzBillz15:07:05

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

danieroux15:07:53

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

danieroux15:07:18

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

danieroux15:07:01

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

ChillPillzKillzBillz16:07:26

Thanks I'll give it a try

ChillPillzKillzBillz16:07:19

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

ChillPillzKillzBillz16:07:12

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.

galdre13:07:11

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 https://clojurescript.org/reference/dependencies 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 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind bind the fn back to the object you pulled it off of for it to work. Have fun!

👍 2