Fork me on GitHub
#luminus
<
2018-05-23
>
codonovan13:05:58

I've got medium sized project, couple of years old now. app.js is 773k (195k gzipped)

sveri14:05:56

@deg @codonovan IIRC uberjar produces two jars, one including the library dependencies and one only containing the class and resource files. I'd assume you are looking into the one without the dependencies.

deg14:05:54

@sveri I'm talking about the app.js file that gets downloaded to the browser. It is the same size in both builds; it does not depend on the Clojure dependencies.

sveri14:05:23

@deg Ah sorry, I misunderstood your question then, please ignore my answer.

codonovan14:05:21

@deg in your uberjar -> cljsbuild do have optimizations set to advanced?

codonovan14:05:44

:profiles {
             ;; :provided {:dependencies [[org.clojure/clojurescript "1.9.518"]
             ;;                           [sablono "0.7.4"]]}

             ;; production builds
             :uberjar {;; AOT (Ahead Of Time) compilation
                       ;;
                       ;; see: 
                       ;;
                       :aot :all
                       :omit-source true
                       :env {:production true}
                       ;; build all cljs
                       :prep-tasks ["compile" ["cljsbuild" "once"]]
                       ;; pull in production specific clj sources and resources
                       :source-paths   ["env/prod/clj"]
                       :resource-paths ["env/prod/resources"]
                       ;; gets merged with default cljsbuild which compiles *.cljs and *.cljc
                       ;; files in source paths src/client and src/shared - here we set extra
                       ;; flags for our uberjar/production build - note how we include source
                       ;; path env/prod/cljs
                       :cljsbuild {:builds
                                   {:app
                                    ;; pull in production specific cljs sources
                                    {:source-paths ["env/prod/cljs"]
                                     :compiler
                                     ;; get medieval on the compiled output
                                     {:optimizations :advanced
                                      :pretty-print  false
                                      :externs ["externs/leaflet.js"]
                                      :closure-warnings
                                      {:non-standard-jsdoc :off}}}}}}}