Skip to content

Instantly share code, notes, and snippets.

@timgilbert
Created January 15, 2016 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timgilbert/92061473de229fbb94c8 to your computer and use it in GitHub Desktop.
Save timgilbert/92061473de229fbb94c8 to your computer and use it in GitHub Desktop.
;; Hook used to start a repl from Cursive. See
;; https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL
;; Click Run->Edit configurations.
;; Click the + button at the top left and choose Clojure REPL
;; Enter a name in the Name field (e.g. "REPL")
;; Choose the radio button Use clojure.main in normal JVM process
;; In the Parameters field put script/repl.clj
;; Click the OK button to save your REPL config.
(require '[figwheel-sidecar.repl-api :as api]
'[figwheel-sidecar.config :as config])
;; The map below is what would be returned from (figwheel-sidecar.repl/get-project-cljs-builds)
;; if it correctly handled profile merging, which it does not. See:
;; https://github.com/bhauman/lein-figwheel/blob/master/sidecar/src/figwheel_sidecar/repl.clj
(def merged-cljsbuild-config
{:dev {:source-paths ["env/dev" "src/cljs" "src/cljc"]
:figwheel {:on-jsload "goldfinger.core/mount-root"
:css-dirs ["resources/public/css"]}
:compiler {:main 'goldfinger.core
:output-to "resources/public/js/compiled/dev/app.js"
:source-map "resources/public/js/compiled/dev/app.js.map"
:output-dir "resources/public/js/compiled/dev"
:source-map-timestamp true
:optimizations :none
:asset-path "js/compiled/dev"}}})
(api/start-figwheel! {:figwheel-options {:css-dirs ["resources/public/css"]}
:all-builds (config/prep-builds merged-cljsbuild-config)})
(api/cljs-repl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment