包括使用Figwheel编译到Uberjar的JS文件 [英] Including JS files compiled using Figwheel to Uberjar built

查看:108
本文介绍了包括使用Figwheel编译到Uberjar的JS文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是Figwheel配置app.cljs.edn

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",
 }

问题是,它仅在dev中有效.我应该如何在由uberjar创建的.jar中包括已编译的JS文件?

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

推荐答案

已将app.cljs.edn修改为

^{: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"}

现在开始打包.

注意:省略:output-to不是关键.将target/更改为resources/可以解决问题.并且,请就最佳做法向我提供建议.谢谢.

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

这篇关于包括使用Figwheel编译到Uberjar的JS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆