Kaynağa Gözat

added small web script with figwheel

Harlan Iverson 9 yıl önce
ebeveyn
işleme
6d551eb139

+ 8 - 0
web-client/figwheel_server.log

@@ -0,0 +1,8 @@
+Compiling "resources/public/gen/js/main.js" from ["src"]...
+notifying browser that file changed:  resources/public/gen/js/goog/deps.js
+notifying browser that file changed:  resources/public/gen/js/cljs_deps.js
+notifying browser that file changed:  out/example/core.js
+Successfully compiled "resources/public/gen/js/main.js" in 1.316 seconds.
+Compiling "resources/public/gen/js/main.js" from ["src"]...
+notifying browser that file changed:  out/example/core.js
+Successfully compiled "resources/public/gen/js/main.js" in 0.59 seconds.

+ 45 - 0
web-client/project.clj

@@ -0,0 +1,45 @@
+(defproject com.analogzen.clojure-stack/web-client "0.0.1-SNAPSHOT"
+            :dependencies [[org.clojure/clojure :clj1.8]
+                           [org.clojure/clojurescript :cljs1.8]
+                           [reagent "0.5.1"
+                            :exclusions [org.clojure/tools.reader]]]
+
+            :plugins [[lein-modules "0.3.11"]
+                      [lein-figwheel "0.5.0-4"]
+                      [lein-environ "1.0.2"]]
+
+            ; opinion: two options: 1) start with figwheel for dev. 2) start with main entry point.
+
+            :clean-targets ^{:protect false} [:target-path "resources/public/gen"]
+
+            ; opinion: dev should be a layer on top of prod. system-map can be updated by dev accordingly, before (start)
+
+            :cljsbuild {:builds [{:id "dev"
+
+                                  :source-paths ["src"]
+
+                                  ; it's nice to show all the options. editor option could be a projection of defaults,
+                                  ; from getting effective project model.
+
+                                  :figwheel {:server-ip "127.0.0.1"
+                                             :server-port 3449
+                                             :server-logfile "figwheel_server.log"
+                                             :http-server-root "public"
+
+
+                                             :heads-up-display true
+                                             :repl true
+                                             :nrepl-port 7888
+                                             :css-dirs ["resources/public/css"]
+                                             }
+                                  :compiler {:main "example.core"
+                                             :output-to "resources/public/gen/js/main.js"
+                                             :output-dir "resources/public/gen/js"
+                                             :asset-path "gen/js"}}]}
+
+
+
+
+
+
+            :min-lein-version "2.5.0")

+ 7 - 0
web-client/resources/public/index.html

@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<head></head>
+<body>
+<script src="gen/js/main.js" type="text/javascript"></script>
+</body>
+</html>

+ 5 - 0
web-client/src/example/core.cljs

@@ -0,0 +1,5 @@
+(ns example.core)
+
+(.log js/console "Hey Seymore, sup?")
+
+