File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,10 @@ classpath. Classpath-relative paths have prefix of @ or @/")
185
185
[cfg path]
186
186
(assoc-in cfg [:options :output-to ] path))
187
187
188
+ (defn- deps-cmd-opt
189
+ [cfg deps-cmd]
190
+ (assoc-in cfg [:options :deps-cmd ] deps-cmd))
191
+
188
192
(defn- target-opt
189
193
[cfg target]
190
194
(let [target (if (= " node" target) " nodejs" target)]
@@ -600,6 +604,9 @@ present"
600
604
[" -o" " --output-to" ] {:group ::compile :fn output-to-opt
601
605
:arg " file"
602
606
:doc " Set the output compiled file" }
607
+ [" --deps-cmd" ] {:group ::compile :fn deps-cmd-opt
608
+ :arg " string"
609
+ :doc " Set the node dependency manager. Only npm or yarn supported" }
603
610
[" -O" " --optimizations" ] {:group ::compile :fn optimize-opt
604
611
:arg " level"
605
612
:doc
Original file line number Diff line number Diff line change 205
205
:watch :watch-error-fn :watch-fn :install-deps :process-shim :rename-prefix :rename-prefix-namespace
206
206
:closure-variable-map-in :closure-property-map-in :closure-variable-map-out :closure-property-map-out
207
207
:stable-names :ignore-js-module-exts :opts-cache :aot-cache :elide-strict :fingerprint :spec-skip-macros
208
- :nodejs-rt :target-fn })
208
+ :nodejs-rt :target-fn :deps-cmd })
209
209
210
210
(def string->charset
211
211
{" iso-8859-1" StandardCharsets/ISO_8859_1
2539
2539
(recur buf)))))
2540
2540
2541
2541
(defn maybe-install-node-deps!
2542
- [{:keys [npm-deps verbose] :as opts}]
2542
+ [{:keys [deps-cmd npm-deps verbose] :or {deps-cmd " npm " } :as opts}]
2543
2543
(let [npm-deps (merge npm-deps (compute-upstream-npm-deps opts))]
2544
2544
(when-not (empty? npm-deps)
2545
2545
(let [pkg-json (io/file " package.json" )]
2548
2548
(when-not (.exists pkg-json)
2549
2549
(spit pkg-json " {}" ))
2550
2550
(let [proc (-> (ProcessBuilder.
2551
- (into (cond->> [" npm" " install" " @cljs-oss/module-deps" ]
2551
+ (into (cond->>
2552
+ [deps-cmd
2553
+ ({" npm" " install" " yarn" " add" } deps-cmd)
2554
+ " @cljs-oss/module-deps" ]
2552
2555
util/windows? (into [" cmd" " /c" ]))
2553
2556
(map (fn [[dep version]] (str (name dep) " @" version)))
2554
2557
npm-deps))
You can’t perform that action at this time.
0 commit comments