Skip to content

Instantly share code, notes, and snippets.

@torgeir
Last active May 12, 2017 15:16
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torgeir/9ca37a782a0e182586c0a884ab17ed5f to your computer and use it in GitHub Desktop.
Save torgeir/9ca37a782a0e182586c0a884ab17ed5f to your computer and use it in GitHub Desktop.
Figwheel boot clj setup, live reloading cljs and css
(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)))
<!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>
body {
background-color: #333;
color: #efefef;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment