Created
February 28, 2018 07:08
-
-
Save reedho/302fabea63ab3416200462e192c39827 to your computer and use it in GitHub Desktop.
Using clojure cli with cljs browser repl, figwheel & cider nrepl
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
Run with: | |
clj -R:repl script.clj | |
Then connect emacs with `cider-connect`. |
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
{:paths ["src" "resources"] | |
:deps {org.clojure/clojurescript {:mvn/version "LATEST"}} | |
:aliases | |
{:repl {:extra-deps | |
{ | |
;; piggieback | |
com.cemerick/piggieback | |
{:mvn/version "0.2.2" | |
:exclusions [com.google.javascript/closure-compiler]} | |
;; figwheel-sidecar | |
figwheel-sidecar | |
{:mvn/version "0.5.14" | |
:exclusions [com.google.javascript/closure-compiler]} | |
;; CIDER compatible nREPL | |
cider/cider-nrepl {:mvn/version "0.15.1"} | |
org.clojure/tools.nrepl {:mvn/version "0.2.12"} | |
refactor-nrepl {:mvn/version "2.3.1"}}}}} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<div id="main-area"> | |
</div> | |
<script src="js/main.js" type="text/javascript"></script> | |
</body> | |
</html> |
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 repl-api :refer [cljs-repl]]) | |
(repl-api/start-figwheel! | |
{:figwheel-options {:server-port 5555 | |
;;:http-server-root "public" | |
:nrepl-port 9090 | |
:nrepl-middleware ["cider.nrepl/cider-middleware" | |
"refactor-nrepl.middleware/wrap-refactor" | |
"cemerick.piggieback/wrap-cljs-repl"]} | |
:all-builds [{:id "dev" | |
:figwheel true | |
:source-paths ["src"] | |
:compiler {:main 'clj2.core | |
:asset-path "js/out" | |
:output-to "resources/public/js/main.js" | |
:output-dir "resources/public/js/out" | |
:optimizations :none | |
:source-map true} | |
}]}) | |
(cljs-repl) | |
(System/exit 0) |
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 clj2.core) | |
(print "Yay!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment