Fork me on GitHub

silly thing i cant seem to figure out. when i try to use clojure -A:build with deps.edn =>

  {:main-opts ["-m" "cljs.main" "-co" "build.cljs.edn"]}
and build.cljs.edn =>
{:output-to "target/create-registration/handler.js"
 :output-dir "target/create-registration" 
 :asset-path ""
 :source-map false
 :target :nodejs
 :main "create-registration.handler"
 :optimizations :simple
 :parallel-build true}
for a clojurescript compilation, it automatically adds the browser-repl preload. i tried setting :browser-repl false to no avail. anyone have any ideas?


@nolan I think this is because, since you are only specifying an init option, it is trying to set up a REPL environment in which to process init options, and since no -re is specified, it goes with the default of "browser". But, if you really just want to compile, I think you'd just need to add -c to the end of your :main-opts

wizard 4
clj 4

@mfikes thanks a million man. adding -c worked like magic. strangely enough when i tried -re node i got a pretty cryptic repl error


Perhaps a more accurate way to look at this is to ask the question: "What happens when I don't specify a main option?"

👍 4

right. in this case (with -co specified and nothing else) i was thinking cljs.main wouldnt try to do anything more with a repl. but it makes sense that making that explicit with -c is probably better anyway


thanks again for the tricks. much appreciated


Another way to look at this is you may not really even want the shipping node REPL involved at all -re node pulls cljs.repl.node into the mix, which could very well be nothing you want to have to do with, if, for example you are compiling to just run under node, or you are using figwheel.main or somesuch.


yeah. you hit the nail on the head. this alias is to compile (no repl involved), and i have a separate alias for dev. your answer actually makes the intent of clj/`clojure` more clear to me.


me too 🙂

clj 4