Last active
May 12, 2017 15:16
-
-
Save torgeir/9ca37a782a0e182586c0a884ab17ed5f to your computer and use it in GitHub Desktop.
Figwheel boot clj setup, live reloading cljs and css
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
(set-env! :dependencies '[ | |
[org.clojure/clojure "1.8.0" :scope "provided"] | |
[org.clojure/clojurescript "1.9.89" :scope "provided"] | |
[ajchemist/boot-figwheel "0.5.4-5"] ;; latest release | |
[org.clojure/tools.nrepl "0.2.12" :scope "test"] | |
[com.cemerick/piggieback "0.2.1" :scope "test"] | |
[figwheel-sidecar "0.5.4-5" :scope "test"] | |
[pandeiro/boot-http "0.7.2" :scope "test"]]) | |
(def web-root "resources/public/") | |
(require | |
'boot-figwheel | |
'[pandeiro.boot-http :refer [serve]]) | |
; avoid some figwheel symbols | |
(refer 'boot-figwheel :rename '{cljs-repl fw-cljs-repl}) | |
(task-options! | |
figwheel | |
{:build-ids ["dev"] | |
:all-builds [{:id "dev" | |
:source-paths ["src"] ; cljs(cljc) directories | |
:compiler {:main 'app.core | |
:output-to "app.js"} | |
:figwheel {:build-id "dev" | |
:on-jsload 'app.core/main | |
:heads-up-display true | |
:autoload true | |
:debug false | |
}}] | |
:figwheel-options {:open-file-command "emacsclient" | |
:repl true | |
:css-dirs [web-root]} | |
:target-path web-root}) | |
(deftask dev [] | |
(comp | |
(serve :dir web-root) | |
(repl) | |
(figwheel) | |
(wait))) |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>wow</title> | |
<link href="styles.css"></link> | |
</head> | |
<body> | |
<script src="app.js"></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
boot dev |
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
body { | |
background-color: #333; | |
color: #efefef; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment