Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ulysses-front/src/clj/figwheel.clj
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
56 lines (46 sloc)
1.42 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require | |
'[figwheel-sidecar.repl-api :as ra] | |
'[com.stuartsierra.component :as component] | |
'[clojure.string :as string]) | |
(import 'java.lang.Runtime) | |
(def figwheel-config | |
{:figwheel-options {:css-dirs ["resources/public/css"]} | |
:build-ids ["dev", "test"] ; NOTE test as well? | |
:all-builds | |
[{:id "dev" | |
:source-paths ["src/cljs"] | |
:figwheel {:on-jsload "ulysses.core/mount-root"} | |
:compiler {:main "ulysses.core" | |
:output-to "resources/public/js/compiled/app.js" | |
:output-dir "resources/public/js/compiled/out" | |
:asset-path "js/compiled/out" | |
:source-map-timestamp true}} | |
{:id "test" | |
:source-paths ["src/cljs" "test/cljs"] | |
:compiler {:output-to "resources/public/js/compiled/test.js" | |
:main "ulysses.runner" | |
:optimizations :none}}]}) | |
(defrecord Figwheel [] | |
component/Lifecycle | |
(start [config] | |
(ra/start-figwheel! config) | |
config) | |
(stop [config] | |
(ra/stop-figwheel!) | |
config)) | |
(def system | |
(atom | |
(component/system-map | |
:figwheel (map->Figwheel figwheel-config)))) | |
(defn start [] | |
(swap! system component/start)) | |
(defn stop [] | |
(swap! system component/stop)) | |
(defn reload [] | |
(stop) | |
(start)) | |
(defn repl [] | |
(ra/cljs-repl)) | |
;; start the components and the repl | |
(start) | |
(repl) |