Fork me on GitHub
#luminus
<
2017-05-17
>
puzzler20:05:24

Is there an easy way to get the interactive development mode to use automatic advanced compilation of clojurescript in figwheel? My advanced compiled code isn't working (probably the externs aren't quite right), and I want a more interactive flow to figure out what is wrong.

puzzler20:05:55

Looks like maybe I can just change the entry in project.clj under :cljsbuild :builds :app :compiler :optimizations to :advanced

puzzler21:05:47

I also needed to change the source-map field.

yogthos22:05:01

unfortunately the :advanced option is incompatible with figwheel

yogthos22:05:52

note that you can usually pass the js library as the extern in most cases, e.g:

{:id "release"
 :source-paths ["src-cljs"]
 :compiler
 {:output-to "target/cljsbuild/public/js/app.js"
  :optimizations :advanced
  :pretty-print false
  :output-wrapper false
  ;;specify the externs file to protect function names
  :externs ["public/vendor/js/yourlib.js"]
  :closure-warnings {:externs-validation :off
                     :non-standard-jsdoc :off}}}

yogthos22:05:26

so if your library is public/vendor/js/yourlib.js, you just set it as the extern