issue in default compiler options

17 views
Skip to first unread message

Dieter Van Eessen

unread,
Dec 20, 2023, 1:30:55 PM12/20/23
to ClojureScript
Hello,

I was searching why a (js/alert   ) in app.core outside a -main function didn't show and noticed that the default compiler options do something strange.
Using '$clojure -M --main cljs.main  --compile app.core ',  you get 'out/main.js' as output file, and 'out' as output-dir. This also get written into 'out/cljsc_opts.edn'.
But 'out/main.js' still contains:
document.write('<script src="out/goog/deps.js"></script>');
document.write('<script src="out/cljs_deps.js"></script>');

The issue resolves itself when specifying --compile-opts '{:output-to "<file.js>"}' or output-dir. Or is this behaviour actually intended for some reason?

Another question: when playing with browser repl and weasel-websocket repl. Is it generally better to put it in the namespace or to put it inside a '-main' function and compile with --main app.core?

kind regards,
Dieter
Reply all
Reply to author
Forward
0 new messages