                       (.getPath ^File res)
                       (.getPath ^URL res))
                cache (when (or (= (:ns ns-info) 'cljs.core)
-                               (and (:cache-analysis opts) output-dir))
+                               (:cache-analysis opts))
                        (cache-file res ns-info output-dir))]
            (when-not (get-in @env/*compiler* [::namespaces (:ns ns-info)])
-             (if (or (not= (:ns ns-info) 'cljs.core)
-                     (not cache)
+             (if (or (not cache)
                      (requires-analysis? res output-dir))
                (binding [*cljs-ns* 'cljs.user
                          *cljs-file* path

   \":output-dir/some/ns/foo.cljs.cache.edn\". This function does not return a
   meaningful value."
  ([f] (analyze-file f nil))
  ([f {:keys [output-dir] :as opts}]
   (binding [*file-defs* (atom #{})]
     (let [res (cond
                 (instance? File f) f
                 (instance? URL f) f
                 (re-find #"^file://" f) (URL. f)

                            (if forms
                              (let [form (first forms)
                                    env (assoc env :ns (get-namespace *cljs-ns*))
                                    ast (analyze env form nil opts)]
                                (if (= (:op ast) :ns)
                                  (recur (:name ast) (next forms))
                                  (recur ns (next forms))))
