Am I missing something or :preloads doesn't work with a basic cljs.main repl?
clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.12.134"} binaryage/devtools {:mvn/version "1.0.7"}}}}' -M -m cljs.main -co '{:preloads [devtools.preload]}' -r
That would verify at least that devtools.preload exists because if I misspell it, it will complain, but it doesn't load the file (it doesn't show any logs in the browser console).
If I then (require 'devtools.preload) at the cljs repl it works correctly.thanks for the the patch! if you have submitted the CA can you please attach the patch to the issue I created? I agree this should just work 🙂 https://clojure.atlassian.net/browse/CLJS-3469
@dnolen yes I had submitted the CA, just attached the patch on the ticket!
thanks!!!
you are welcome!
Can you create the patch this way - https://clojurescript.org/community/patches - then it preserves the author, can be applied w/ git am etc.
no need to run tests for this, CI handle that
thanks applying - https://github.com/clojure/clojurescript/pull/302
merged
great, thanks!
Adding --compile with a file does load the preload :
clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.12.134"} binaryage/devtools {:mvn/version "1.0.7"}}}}' -M -m cljs.main -co '{:preloads [devtools.preload]}' --compile bla.core --replIt looks like the preloads doesn't get compiled if you just run with --repl. If you first run with --compile, after the out dir is created, running with just --repl works
Yeah, cljs.main CLI arguments are finicky. Some are order-dependant, some are exclusive.