How to add lib with jars to shared folder?

2019-06-09 00:20发布

I have a cross building scala-js project with a client, server and shared folder. If I add a lib folder with some jars in the server project folder I can reference the classes in the jars in my server code. But if add the lib folder in the shared project folder I can't reference the classes in my shared code. Can I add some command in my sbt build file to get my jars visible in my shared project or what should I do?

标签: scala.js
1条回答
爷、活的狠高调
2楼-- · 2019-06-09 01:00

.jars should never be shared, since it is not the same .jar for Scala/JVM and Scala.js, even if they have the same source code.

If you have the two .jars for JVM and JS, you can put them in shared/jvm/lib/ and shared/js/lib/, respectively.

(if you use .crossType(CrossType.Pure), use .jvm/.js instead of jvm/js)

查看更多
登录 后发表回答