File tree 1 file changed +7
-8
lines changed
src/main/clojure/cljs/repl
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 172
172
clojure.browser.repl/PORT ~port}
173
173
cljsc/normalize-closure-defines
174
174
json/write-str)]
175
- ; ; TODO: this could be cleaner if compiling forms resulted in a
176
- ; ; :output-to file with the result of compiling those forms - David
177
- (let [f (io/file " out/cljs_deps.js" )]
178
- (when-not (.exists f)
179
- (spit f
180
- (build/build
181
- '[(require '[clojure.browser.repl.preload])] {:optimizations :none }))))
182
175
(server/send-and-close conn 200
183
176
(str " var CLOSURE_UNCOMPILED_DEFINES = " closure-defines " ;\n "
184
177
" var CLOSURE_NO_DEPS = true;\n "
281
274
; ; =============================================================================
282
275
; ; BrowserEnv
283
276
284
- (defn setup [{:keys [working-dir] :as repl-env} opts]
277
+ (defn setup [{:keys [working-dir] :as repl-env} { :keys [output-dir] :as opts} ]
285
278
(binding [browser-state (:browser-state repl-env)
286
279
ordering (:ordering repl-env)
287
280
es (:es repl-env)
294
287
{:optimizations :simple
295
288
:output-dir working-dir}
296
289
(io/file working-dir " brepl_client.js" )))))
290
+ ; ; TODO: this could be cleaner if compiling forms resulted in a
291
+ ; ; :output-to file with the result of compiling those forms - David
292
+ (when (and output-dir (not (.exists (io/file output-dir))))
293
+ (spit (io/file " out/cljs_deps.js" )
294
+ (build/build
295
+ '[(require '[clojure.browser.repl.preload])] {:optimizations :none })))
297
296
(repl/err-out
298
297
(println " Serving HTTP on" (:host repl-env) " port" (:port repl-env))
299
298
(println " Listening for browser REPL connect ..." ))
You can’t perform that action at this time.
0 commit comments