我正在尝试使用'providedJS'这样:
jsDependencies ++= Seq(
...,
ProvidedJS / "my-script.js"
)
并将javascript文件放在src/main/resources
收到以下错误:
(client/compile:scalaJSPreLinkClasspath)
org.scalajs.core.tools.classpath.JSLibResolveException:
Some references to JS libraries could not be resolved:
- Missing JS library: my-script.js
答案 0 :(得分:0)
将其放入./src/main/resources/my-script.js
答案 1 :(得分:0)
将 addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")
和 addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.0")
添加到 plugins.sbt
将 jsDependencies += ProvidedJS / "my-script.js"
添加到 build.sbt
把你的文件放到/src/main/resources/my-script.js
运行sbt clean compile fastOptJS
搜索您的文件 <project_dir>/target/scala-2.12/<your_project>_js-jsdeps.js
答案 2 :(得分:-1)
根据http://www.scala-js.org/doc/project/dependencies.html,您的代码段是正确的 - 但是,值得检查构建的其他部分,例如: https://groups.google.com/forum/#!topic/scala-js/8JzjI5MK4kI