Including JS files compiled using Figwheel to Uberjar built

感情迁移 提交于 2020-05-17 05:53:06

问题


Here is Figwheel config, app.cljs.edn

^{:watch-dirs ["src/cljs" "src/cljc"]}
{:modules
 {:aff {:entries #{asaas.aff.aff}
        :output-to "target/public/js/aff.js"}
  :loc {:entries #{asaas.aff.loc}
        :output-to "target/public/js/loc.js"}  
  :user {:entries #{asaas.user.user}
         :output-to "target/public/js/user.js"}
  :auth {:entries #{asaas.auth.auth}
         :output-to "target/public/js/auth.js"}}
 :output-dir "target/public/js/app"
 :asset-path "/js/app",
 }

The problem is, it just works in dev. How should I go about including compiled JS files in my .jar, created by uberjar?


回答1:


Modified app.cljs.edn to,

^{:watch-dirs ["src/cljs" "src/cljc"]}
{:modules
 {:aff {:entries #{asaas.aff.aff}}
  :loc {:entries #{asaas.aff.loc}}
  :user {:entries #{asaas.user.user}}
  :auth {:entries #{asaas.auth.auth}}}

 :output-dir "resources/public/js/app"
 :asset-path "/js/app"}

Now it's getting packaged.

Note: Omission of :output-to is not the key; changing target/ to resources/ did the trick. And please, advise me on best practice. Thanks.



来源:https://stackoverflow.com/questions/61317301/including-js-files-compiled-using-figwheel-to-uberjar-built

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!