Skip to content

Commit

Permalink
compile js to single file for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Travers committed Jul 9, 2024
1 parent 57fb7ab commit 7533f49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
:license {:name "Apache 2 License"
:url "https://opensource.org/licenses/Apache-2.0"}
:dependencies [;; Clojure
[org.clojure/clojure "1.11.1"]
[org.clojure/clojure "1.11.3"]
[hiccup "1.0.5"]
[clj-commons/clj-yaml "0.7.0"]
[me.raynes/fs "1.4.6"]
;; Clojurescript
[org.clojure/clojurescript "1.10.520"]
[org.candelbio/multitool "0.1.0"]
[org.candelbio/multitool "0.1.6"]
[reagent "0.8.1"]
[re-frame "0.10.6"]
]
Expand All @@ -30,7 +30,7 @@
:profiles {:library {:prep-tasks ["compile" ["cljsbuild" "once"]]
}
:uberjar {:aot :all
:prep-tasks ["compile" ["cljsbuild" "once"]]
:prep-tasks ["compile" ["cljsbuild" "once" "uberjar"]]
:omit-source true}
:dev {:dependencies [[cider/piggieback "0.3.10"]
[day8.re-frame/re-frame-10x "0.3.3"]
Expand Down Expand Up @@ -75,7 +75,12 @@

:cljsbuild {:builds {:client {:source-paths ["src/clj" "src/cljs" "src/cljc" "env/prod/cljs"]
:compiler {:output-dir "resources/public/js"
:output-to "resources/public/js/client.js"}}}}
:output-to "resources/public/js/client.js"}}
:uberjar {:source-paths ["src/clj" "src/cljs" "src/cljc" "env/prod/cljs"]
:compiler {:output-dir "resources/public/jsu"
:output-to "resources/public/jsu/client.js"
:optimizations :advanced ;not working AFICT
}}}}

:figwheel {
:server-port 3452
Expand Down
2 changes: 1 addition & 1 deletion src/clj/org/candelbio/alzabo/html.clj
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
#_ (make-link (output-file "alzabo.css") "../../alzabo.css")
(io/copy (io/reader (io/resource "public/alzabo.css"))
(io/file (output-file "alzabo.css")))
(io/copy (io/reader (io/resource "public/js/client.js"))
(io/copy (io/reader (io/resource "public/jsu/client.js")) ;Copy the uberjar version, which is single-file, so might actually work
(io/file (output-file "client.js")))
nil
)
Expand Down

0 comments on commit 7533f49

Please sign in to comment.