(requires-compilation? src dest)
(requires-compilation? src dest opts)
Return true if the src file requires compilation.
Source
(defn requires-compilation?
"Return true if the src file requires compilation."
([src dest]
(requires-compilation? src dest
(when env/*compiler*
(:options @env/*compiler*))))
([^File src ^File dest opts]
(let [{:keys [ns requires]} (ana/parse-ns src)]
(if (and (= 'cljs.loader ns) (not (contains? opts :cache-key)))
false
(ensure
(or (not (.exists dest))
(util/changed? src dest)
(let [version' (util/compiled-by-version dest)
version (util/clojurescript-version)]
(and version (not= version version')))
(and opts
(not (and (io/resource "cljs/core.aot.js") (= 'cljs.core ns)))
(not= (build-affecting-options opts)
(build-affecting-options (util/build-options dest))))
(and opts (:source-map opts)
(if (= (:optimizations opts) :none)
(not (.exists (io/file (str (.getPath dest) ".map"))))
(not (get-in @env/*compiler* [::compiled-cljs (.getAbsolutePath dest)]))))
(when-let [recompiled' (and *recompiled* @*recompiled*)]
(some requires recompiled'))))))))