File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 16
16
[cljs.env :as env]
17
17
[cljs.js-deps :as deps]
18
18
[clojure.java.io :as io]
19
+ [clojure.java.shell :as sh]
19
20
[clojure.reflect]
20
21
[clojure.set :as set]
21
22
[clojure.string :as string]
205
206
:watch :watch-error-fn :watch-fn :install-deps :process-shim :rename-prefix :rename-prefix-namespace
206
207
:closure-variable-map-in :closure-property-map-in :closure-variable-map-out :closure-property-map-out
207
208
:stable-names :ignore-js-module-exts :opts-cache :aot-cache :elide-strict :fingerprint :spec-skip-macros
208
- :nodejs-rt :target-fn :deps-cmd })
209
+ :nodejs-rt :target-fn :deps-cmd :bundle-cmd })
209
210
210
211
(def string->charset
211
212
{" iso-8859-1" StandardCharsets/ISO_8859_1
3169
3170
(output-one-file opts)))))
3170
3171
(apply output-unoptimized opts js-sources))]
3171
3172
(output-bootstrap opts)
3173
+ (when (bundle? opts)
3174
+ (when-let [cmd (and (= :none optim)
3175
+ (get-in opts [:bundle-cmd :none ]))]
3176
+ (let [{:keys [exit out]}
3177
+ (try
3178
+ (apply sh/sh cmd)
3179
+ (catch Throwable t
3180
+ (throw
3181
+ (ex-info " :build-cmd :none failed"
3182
+ {:cmd cmd} t))))]
3183
+ (when-not (== 0 exit)
3184
+ (throw
3185
+ (ex-info " :bundle-cmd :none failed"
3186
+ {:cmd cmd :exit-code exit :std-out out})))))
3187
+ (when-let [cmd (and (not= :none optim)
3188
+ (get-in opts [:bundle-cmd :default ]))]
3189
+ (let [{:keys [exit out]}
3190
+ (try
3191
+ (apply sh/sh cmd)
3192
+ (catch Throwable t
3193
+ (ex-info " :build-cmd :default failed"
3194
+ {:cmd cmd} t)))]
3195
+ (when-not (== 0 exit)
3196
+ (throw
3197
+ (ex-info " :bundle-cmd :default failed"
3198
+ {:cmd cmd :exit-code exit :std-out out}))))))
3172
3199
ret))))))
3173
3200
3174
3201
(comment
You can’t perform that action at this time.
0 commit comments