Fork me on GitHub

I'd like to run some clojure code, from within the src code dir of a project, where I can get to the contents of :external-config (or some place to store a configurable var) in that clojure ns, and then shell out to cli commands that depend on the configuration vars. Do I have to handle launching the figwheel/cljs compiler manually in order to get at the env on the clojure side? Or can I get to it by requiring some things? I basically just need to be able to get some project-wide conf data from both clojure and clojurescript


The way I would think you have to do it is to start figwheel manually. I don't know of any pre-run hooks available to help. I'd try something like this:

(ns my-ns (:require [figwheel.main]))
(defn -main
  (figwheel.main/start :dev))
And then start with clj -m my-ns


Makes sense. Thanks @UDVJE9RE3!


Worked out pretty good!


Hell yeah. I'm glad it worked because I did not try it myself lol


Almost like just a custom plugin I can conditionally run before everything runs, to help set up other services. Any recommendations for how to go about that? Should I just drop the shell-outs in the user ns or is there a way to call a src file on the classpath as a preload?


Being able to add a shell command directly the deps.edn or figwheel's dev.cljs.edn, that gets called in addition to the main, would suffice I think