Fork me on GitHub
#clojurescript
<
2018-11-18
>
Nolan23:11:37

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

...
 :aliases
 {:build
  {: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?

mfikes23:11:15

@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
Nolan23:11:32

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

mfikes23:11:06

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
Nolan23:11:30

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

Nolan23:11:02

thanks again for the tricks. much appreciated

mfikes23:11:28

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.

Nolan23:11:06

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.

mfikes23:11:24

me too 🙂

clj 4