|
817 | 817 | (catch Throwable e |
818 | 818 | (caught e repl-env opts) |
819 | 819 | opts)))) |
| 820 | + ;; TODO: consider alternative ways to deal with JS module processing at REPL |
| 821 | + opts' opts ;; need to save opts prior to JS module processing for watch |
820 | 822 | opts (if (or (:libs opts) (:foreign-libs opts)) |
821 | 823 | (let [opts (cljsc/process-js-modules opts)] |
822 | 824 | (swap! env/*compiler* assoc :js-dependency-index (deps/js-dependency-index opts)) |
|
863 | 865 | (init) |
864 | 866 | (catch Throwable e |
865 | 867 | (caught e repl-env opts))) |
866 | | - (when-let [src (:watch opts)] |
867 | | - (.start |
868 | | - (Thread. |
869 | | - ((ns-resolve 'clojure.core 'binding-conveyor-fn) |
870 | | - (fn [] |
871 | | - (let [log-file (io/file (util/output-directory opts) "watch.log")] |
872 | | - (err-out (println "Watch compilation log available at:" (str log-file))) |
873 | | - (try |
874 | | - (let [log-out (FileWriter. log-file)] |
875 | | - (binding [*err* log-out |
876 | | - *out* log-out] |
877 | | - (cljsc/watch src (dissoc opts :watch) |
878 | | - env/*compiler* done?))) |
879 | | - (catch Throwable e |
880 | | - (caught e repl-env opts))))))))) |
| 868 | + ;; TODO: consider alternative ways to deal with JS module processing at REPL |
| 869 | + (let [opts opts'] ;; use opts prior to JS module processing |
| 870 | + (when-let [src (:watch opts)] |
| 871 | + (.start |
| 872 | + (Thread. |
| 873 | + ((ns-resolve 'clojure.core 'binding-conveyor-fn) |
| 874 | + (fn [] |
| 875 | + (let [log-file (io/file (util/output-directory opts) "watch.log")] |
| 876 | + (err-out (println "Watch compilation log available at:" (str log-file))) |
| 877 | + (try |
| 878 | + (let [log-out (FileWriter. log-file)] |
| 879 | + (binding [*err* log-out |
| 880 | + *out* log-out] |
| 881 | + (cljsc/watch src (dissoc opts :watch) |
| 882 | + env/*compiler* done?))) |
| 883 | + (catch Throwable e |
| 884 | + (caught e repl-env opts)))))))))) |
881 | 885 | ;; let any setup async messages flush |
882 | 886 | (Thread/sleep 50) |
883 | 887 | (binding [*in* (if (true? (:source-map-inline opts)) |
|
0 commit comments