Fork me on GitHub
#figwheel-main
<
2019-08-24
>
roti09:08:16

I can't get hot reloading to work with clojure code. Here's my build

^{:watch-dirs ["src/cljs", "src/clj"]
  :reload-clj-files [:clj]
  :ring-handler com.example.server/app
  :css-dirs ["resources/public/css"]}
{:main com.example}
It fails because figwheel does not accept src/clj as watch folder, since there are no .cljs files there. Did somebody get it to work?

dimovich12:08:07

@roti figwheel doesn't support reloading clj files directly. It automatically reloads only those that contain macros used by the cljs files.

dimovich12:08:30

so adding "src/clj" to the :watch-dirs won't work

thiru15:08:43

@roti I wrote a small library for this. The code is quite simple and based on what fighweel does. Maybe you can just take the code from core.clj rather than depend on the lib if you'd like: https://github.com/thiru/clj-reloader

dimovich17:08:05

that's exactly what clojure.tools.namespace.* provides -> loading and unloading code.

thiru03:08:37

Oh cool will need to check that out.. thanks!

dimovich22:08:21

@roti here is a proof of concept that uses figwheel.main.watching and clojure.tools.namespace.*. You already have them as dependencies. https://github.com/dimovich/deps-cider-cljs-reagent/blob/watch/watch.clj