Last active
June 1, 2022 10:51
-
-
Save athanhat/9624155dcda3e42091ff028b7efdd532 to your computer and use it in GitHub Desktop.
figwheel project user namespace - start figwheel server
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
(ns user | |
(:require | |
[figwheel-sidecar.repl-api :as f])) | |
;; user is a namespace that the Clojure runtime looks for and | |
;; loads if its available | |
;; You can place helper functions in here. This is great for starting | |
;; and stopping your webserver and other development services | |
;; The definitions in here will be available if you run "lein repl" or launch a | |
;; Clojure repl some other way | |
;; You have to ensure that the libraries you :require are listed in your dependencies | |
;; Once you start down this path | |
;; you will probably want to look at | |
;; tools.namespace https://github.com/clojure/tools.namespace | |
;; and Component https://github.com/stuartsierra/component | |
(defn fig-start | |
"This starts the figwheel server and watch based auto-compiler." | |
[] | |
;; this call will only work as long as your :cljsbuild and | |
;; :figwheel configurations are at the top level of your project.clj | |
;; and are not spread across different lein profiles | |
;; otherwise you can pass a configuration into start-figwheel! manually | |
(f/start-figwheel!)) | |
(defn fig-stop | |
"Stop the figwheel server and watch based auto-compiler." | |
[] | |
(f/stop-figwheel!)) | |
;; if you are in an nREPL environment you will need to make sure you | |
;; have setup piggieback for this to work | |
(defn cljs-repl | |
"Launch a ClojureScript REPL that is connected to your build and host environment." | |
[] | |
(f/cljs-repl)) | |
;; starts the figwheel server and watch based auto-compiler | |
(fig-start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment