         source-file-names
         (into #{} (map #(.getName %)) source-files)
 
-        cached-source-files
-        (for [{:keys [resource-name ns] :as src} cached-sources]
-          ;; cannot pass the rewritten code in here again since closure identifies it as the wrong type
-          ;; previously it was an ES MODULE now its SCRIPT which blows up internally
-          ;; FIXME: figure out a more fool proof way of doing this or skip incremental compiles entirely
-          (closure-source-file resource-name
-            (str "goog.provide(\"" (cljs-comp/munge ns) "\");")))
-
         source-files
         ;; closure prepends polyfills to the first resource
         ;; adding an empty placeholder ensures we can take them out easily
         (-> [(closure-source-file polyfill-name "")]
             ;; then add all resources
             (into shadow-js-files)
-            (into cached-source-files)
             (into source-files))
 
         ;; this includes all files (sources + package.json files)

  "takes a list of :js sources and rewrites them to using closure
   partial compiles must supply the cached sources so closure doesn't complain about things
   it cannot resolve"
  [{:keys [project-dir npm mode] :as state} sources cached-sources]

  (let [source-files
        (for [{:keys [resource-name file] :as src} sources]

                      (cache/write-file cache-file output)

                      (assoc idx resource-id cache-key)))
                  sources))))]

    (when need-compile?
      (cache/write-file cache-index-file cache-index-updated))
