         :alias {:default [:chrome]}
         :paths {:karma "./node_modules/karma/bin/karma"}}
 
-  :cljsbuild {:builds {:dev {:source-paths ["src-cljs" "test-cljs"]
+  :cljsbuild ~(let [warning-handlers ['(fn [warning-type env extra]
+                                         (when (warning-type cljs.analyzer/*cljs-warnings*)
+                                           (when-let [s (cljs.analyzer/error-message warning-type extra)]
+                                             (binding [*out* *err*]
+                                               (println "WARNING:" (cljs.analyzer/message env s)))
+                                             (System/exit 1))))]]
+                `{:builds {:dev {:source-paths ["src-cljs" "test-cljs"]
                              ;; Port 4444 is proxied (with SSL) to 3449 (the Figwheel server port).
                              :figwheel {:websocket-url "wss://prod.circlehost:4444/figwheel-ws"}
                              :compiler {:output-to "resources/public/cljs/out/frontend-dev.js"

                                                         "src-cljs/js/d3-externs.js"
                                                         "src-cljs/js/prismjs-externs.js"
                                                         "src-cljs/js/bootstrap-externs.js"]
                                               :source-map "resources/public/cljs/production/frontend.js.map"}}}}
  :profiles {:devtools {:repl-options {:port 8230
                                       :nrepl-middleware [dirac.nrepl.middleware/dirac-repl]
                                       :init (do

                                         :source-map "resources/public/cljs/test/frontend-test.js.map"}}

                       :production {:source-paths ["src-cljs"]
                                    :warning-handlers ~warning-handlers
                                    :compiler {:pretty-print false
                                               :output-to "resources/public/cljs/production/frontend.js"
                                               :output-dir "resources/public/cljs/production"
