File tree 2 files changed +5
-22
lines changed
2 files changed +5
-22
lines changed Original file line number Diff line number Diff line change 1959
1959
:as opts}]
1960
1960
(let [opts (cond-> (update opts :foreign-libs
1961
1961
(fn [libs]
1962
- (into (into []
1963
- (util/distinct-merge-by :file
1964
- (index-node-modules npm-deps opts)))
1962
+ (into (index-node-modules npm-deps opts)
1965
1963
(expand-libs libs))))
1966
1964
(:closure-defines opts)
1967
1965
(assoc :closure-defines
1981
1979
:optimizations optimizations
1982
1980
:output-dir output-dir
1983
1981
:ups-libs libs
1984
- :ups-foreign-libs (into (into []
1985
- (util/distinct-merge-by :file
1986
- (index-node-modules (compute-upstream-npm-deps opts) opts)))
1982
+ :ups-foreign-libs (into (index-node-modules (compute-upstream-npm-deps opts) opts)
1987
1983
(expand-libs foreign-libs))
1988
1984
:ups-externs externs
1989
1985
:emit-constants emit-constants
2115
2111
(:options @env/*compiler*))))
2116
2112
([npm-deps opts]
2117
2113
(let [node-modules (io/file " node_modules" )]
2118
- (when (and (not (empty? npm-deps)) (.exists node-modules) (.isDirectory node-modules))
2114
+ (if (and (not (empty? npm-deps)) (.exists node-modules) (.isDirectory node-modules))
2119
2115
(let [modules (map name (keys npm-deps))
2120
2116
deps-file (io/file (str (util/output-directory opts) File/separator
2121
2117
" cljs$node_modules.js" ))]
2122
2118
(util/mkdirs deps-file)
2123
2119
(with-open [w (io/writer deps-file)]
2124
2120
(run! #(.write w (str " require('" % " ');\n " )) modules))
2125
- (node-inputs [{:file (.getAbsolutePath deps-file)}] opts))))))
2121
+ (node-inputs [{:file (.getAbsolutePath deps-file)}] opts))
2122
+ []))))
2126
2123
2127
2124
(defn process-js-modules
2128
2125
" Given the current compiler options, converts JavaScript modules to Google
Original file line number Diff line number Diff line change 279
279
xs seen)))]
280
280
(step coll #{}))))
281
281
282
- (defn distinct-merge-by
283
- [f & xss]
284
- (let [xf (map (fn [x]
285
- [(f x) x]))]
286
- (vals (apply merge-with
287
- (fn [a b]
288
- (merge-with
289
- (fn [a b]
290
- (cond-> a
291
- (sequential? a)
292
- (into b)))
293
- a b))
294
- (map #(into {} xf %) xss)))))
295
-
296
282
(defn content-sha [^String s]
297
283
(let [digest (MessageDigest/getInstance " SHA-1" )]
298
284
(.reset digest)
You can’t perform that action at this time.
0 commit comments