                   (into #{} (remove removed-requires) deps)
 
                   output
-                  {:resource-id resource-id
-                   :js js
-                   :source (.getCode source-file)
-                   :removed-requires removed-requires
-                   :actual-requires actual-requires
-                   :properties (into #{} (-> property-collector (.-properties) (.get name)))
-                   :compiled-at (System/currentTimeMillis)
-                   :source-map-json sm-json}]
+                  (-> {:resource-id resource-id
+                       :js js
+                       :source (.getCode source-file)
+                       :removed-requires removed-requires
+                       :actual-requires actual-requires
+                       :properties (into #{} (-> property-collector (.-properties) (.get name)))
+                       :compiled-at (System/currentTimeMillis)}
+                      (cond->
+                        generate-source-map?
+                        (assoc :source-map-json sm-json)))]
 
               (assoc-in state [:output resource-id] output)
               ))


        co-opts
        (merge
          {:source-map true
           ;; :whitespace or :simple work but some patterns really require the DCE done by :simple
           ;; eg some conditional imports done by react&friends
           :optimizations :simple
           :pretty-print false
           :pseudo-names false
           ;; es6+ is transformed by babel first

                       (remove #(str/includes? js (str "(\"" % "\")")))
                       (into #{}))

                  sm-json
                  (when generate-source-map?
                    (let [sw (StringWriter.)]
                      ;; for sourcesContent
                      (.addSourceFile source-map source-file)
                      (.appendTo source-map sw output-name)
                      (.toString sw)))

                  deps
                  (data/deps->syms state rc)
