Files
status-react/env/dev/figwheel_api.clj
T

37 lines
1.0 KiB
Clojure
Raw Normal View History

(ns figwheel-api
2016-11-02 22:27:31 +02:00
(:use [figwheel-sidecar.repl-api :as ra])
(:require [hawk.core :as hawk]
2017-03-21 15:44:47 +03:00
[re-frisk-sidecar.core :as rfs]
[status-im.utils.core :as utils]
[figwheel :as config]))
2016-02-23 01:04:42 +03:00
(defn start-figwheel
2016-11-02 22:27:31 +02:00
"Start figwheel for one or more builds"
[build-ids]
(ra/start-figwheel! (config/system-options build-ids)))
2016-11-02 22:27:31 +02:00
2016-02-23 01:04:42 +03:00
(defn stop-figwheel
2016-11-02 22:27:31 +02:00
"Stops figwheel"
[]
(ra/stop-figwheel!))
2018-01-06 09:02:20 +08:00
(defn start
([]
(start (if *command-line-args*
(map keyword *command-line-args*)
[:android])))
([build-ids]
(hawk/watch! [{:paths ["resources"]
:handler (fn [ctx e]
(let [path "src/status_im/utils/js_resources.cljs"
js-resourced (slurp path)]
(spit path (str js-resourced " ;;"))
(spit path js-resourced))
ctx)}])
(start-figwheel build-ids)
(rfs/-main)))
2018-01-06 09:02:20 +08:00
(def stop ra/stop-figwheel!)
(def start-cljs-repl ra/cljs-repl)