Fork me on GitHub
#re-frame
<
2021-09-14
>
Ryan15:09:19

Ok, so, whats the way to generate a production build? Using Shadow-cljs.. yarn shadow-cljs release ? then is the built folder just public/resources? will attach config

Ryan15:09:42

{:nrepl {:port 8777}

 :source-paths ["src" "test"]

 :dependencies
 [[reagent "1.1.0"]
  [re-frame "1.2.0"]
  [day8.re-frame/tracing "0.6.2"]
  [bidi "2.1.6"]
  [com.rpl/specter "1.1.3"]
  [clj-commons/pushy "0.3.10"]
  [garden "1.3.10"]
  [net.dhleong/spade "1.1.0"]
  [re-pressed "0.3.1"]
  [binaryage/devtools "1.0.3"]
  [re-graph "0.1.15" :exclusions [re-graph.hato]]
  [day8.re-frame/re-frame-10x "1.1.11"]]

 :dev-http
 {8280 "resources/public"
  8290 "target/browser-test"}

 :builds
 {:app
  {:target :browser
   :output-dir "resources/public/js/compiled"
   :asset-path "/js/compiled"
   :modules
   {:app {:init-fn pnx-web.core/init}}
   :devtools
   {:preloads [day8.re-frame-10x.preload]}
   :dev
   {:compiler-options
    {:closure-defines
     { re-frame.trace.trace-enabled? true
      day8.re-frame.tracing.trace-enabled? true}}}
   :release
   {:build-options
    {:ns-aliases
     {day8.re-frame.tracing day8.re-frame.tracing-stubs}}}}
  :browser-test
  {:target    :browser-test
   :ns-regexp "-test$"
   :runner-ns shadow.test.browser
   :test-dir  "target/browser-test"}
  :karma-test
  {:target    :karma
   :ns-regexp "-test$"
   :output-to "target/karma-test.js"}}}

thheller15:09:24

shadow-cljs release app maybe delete resources/public/js/compiled before

Chase20:09:21

I also have {:compiler-options {:optimizations :advanced}} . There are some caveats I guess: https://shadow-cljs.github.io/docs/UsersGuide.html#Optimization and this mentions there are good defaults put in place so maybe that is a redundant add on my part.

thheller05:09:18

@U9J50BY4C :advanced is the default so you do not need to set it