Created
September 10, 2019 16:10
-
-
Save dimovich/20eb3b40b7ee6e6d6fc8155e25c52e1e to your computer and use it in GitHub Desktop.
compile Sass when using figwheel-main
This file contains hidden or 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
;; use with deps.edn | |
;; {:aliases {:sass {:main-opts ["-i sass.clj -m figwheel.main -b dev"]}}} | |
(require '[clojure.java.shell :as sh] | |
'[figwheel.main.watching :as fww]) | |
(println "watching Sass...") | |
;; change comand and location of sass files as needed | |
(defn compile-sass [_] | |
(sh/sh "sass" "sass/main.sass:resources/public/css/main.css") | |
(sh/sh "postcss" "resources/public/css/main.css" "-u" "autoprefixer" | |
"-o" "resources/public/css/prefixed-main.css")) | |
(fww/add-watch! | |
:sass | |
{:paths ["sass"] | |
:filter (fww/suffix-filter #{"sass"}) | |
:handler (fww/throttle 50 compile-sass)}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment