The right way to export things to JavaScript is to use the @JSExportAll annotation. However, you cannot and should not pull the Scala.js libraries into the server project. For this use case, we have a dedicated JVM artifact, scalajs-stubs , which you can add to your JVM project as follows:
libraryDependencies += "org.scala-js" %% "scalajs-stubs" % scalaJSVersion % "provided"
As a “provided” dependency, it will not be present at run time. But this will allow you to compile the JVM project, even if it references JSExportAll .
See also ScalaDoc of cigarette butts .
source share