How to export properties of shared case classes

…衆ロ難τιáo~ 提交于 2019-12-04 03:32:45

The right way to export things to JavaScript is to use the @JSExportAll annotation. You cannot, and should not, pull the Scala.js libraries on the server project, though. For this use case, we have a dedicated JVM artifact, scalajs-stubs, which you can add to your JVM project like this:

libraryDependencies += "org.scala-js" %% "scalajs-stubs" % scalaJSVersion % "provided"

As a "provided" dependency, it will not be present at runtime. But it will allow you to compile the JVM project even though it references JSExportAll.

See also the ScalaDoc of scalajs-stubs.

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