shadow-cljs 2026-01-12

Is it possible to have different :init-fn's for a build when running in debug (watch) vs release mode?

basically :modules {:foo {:init-fn foo/init}} :dev {:modules {:foo {:init-fn bar/init}}}}

everything from :dev or :release is just merged and can replace values

Reasoning: I want to have different entrypoint setup for development and release builds. In the development builds I will wire up some development tools that only exist on the classpath when :dev alias is used, so I would ideally like to have different init namespaces for dev and release builds.

usually that is done via :preloads, but a separate ns/:init-fn is fine too I guess. nothing really wrong with doing it that way.

the above functionality solves my problem exactly as I wanted

damn is there something you haven't thought of?

I have never thought about doing this particular thing before 😛

😀 1

Is the npm interface of shadow-cljs doing some kind of magic behind the scenes in addition to the shadow.cljs.devtools.api that installs extra npm dependencies from cljs dependencies like this: https://github.com/cjohansen/dumdom/blob/master/src/deps.cljs#L6 ? How can I replicate this functionality using the api?