Release builds accidentally strip "unused" namespace requires that register specs when using :target :esm-files.
Reproduction: https://github.com/commiterate/test-clojurescript-esm (the Notes section in the readme has more details)
For example, suppose we have:
ns_x.cljc
(ns ns-x
(:require
#?(:cljs
[cljs.spec.alpha :as spec :include-macros true]
:default
[clojure.spec.alpha :as spec])))
(spec/def ::x number?)
ns_y.cljc
(ns ns-y
(:require
#?(:cljs
[cljs.spec.alpha :as spec :include-macros true]
:default
[clojure.spec.alpha :as spec])
[ns-x :as ns-x]))
(spec/fdef y
:args (spec/cat :keys (spec/keys* :req-un [::ns-x/x]))
:ret number?)
(defn y
"y = 2x"
[& {:keys [x]}]
(* 2 x))
The ns-x namespace import in ns-y will be stripped from the compiled JS code and result in a "spec not found" error when importing the ns-y module.