Fork me on GitHub

How can I add a cljs repl only component to system? I can't add a dependency to dev/user.clj because it's cljs only. Adding it to dev/cljs/user.cljs doesn't have any effect on the reset calls by figwheel, only if I call reset manually in the cljs.user repl.


So... I guess my question is, where are the project.system/go and project.system/reset functions referenced so they are used by figwheel?


Since that is where the init function is called, which specifies the regular production system. I would like to be able to pass a dev-system there.


Ah! :figwheel {:on-jsload "mage2tv.system/reset"} in the project.clj


Maybe I can change that to cljs.user/reset....


hm, nope.


The figwheel sidecar system documentation also assumes the component is compilable by clojure. No dice getting the cljs only devtools into there... hm. Turning the user.clj into a user.cljc and using reader conditionals doesn't help either because the system config evaluation happens in clojure.


Okay, turns out I was on a wild goose hunt. Making a component for devtools is not necessary, adding :preloads [devtools.preload] to the closure compiler options in the project.clj cljs build config is enough.


Oh well, I guess I learned something.