ScalaJS
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.9")
あり(jquery-ui depを含めた後):
libraryDependencies += "be.doeraene" %%% "scalajs-jquery" % "0.9.0",
jsDependencies += "org.webjars" % "jquery" % 2.2.3 / "jquery.js",
jsDependencies += "org.webjars.bower" % "jquery-ui" % "1.11.4" / "draggable.js"
fastOptJS でコンパイルするとエラーが発生します:
[error] - Ambiguous reference to a JS library: jquery.js
[error] Possible paths found on the classpath:
[error] - META-INF/resources/webjars/jquery/2.2.3/jquery.js
[error] - META-INF/resources/webjars/jquery/3.0.0-beta1/src/jquery.js
[error] - META-INF/resources/webjars/jquery/3.0.0-beta1/dist/jquery.js
このスレッドを試してみました: 「JS ライブラリへのあいまいな参照」を解決する方法は? およびこのSBT プロジェクトで webjars と scala-js jars 間の JS 依存関係をトラブルシューティングする方法は?
しかし、それは私を助けていません(まだ)
更新: すべての deps が定義された私のビルド プロジェクト
object BuildProject extends Build {
lazy val myPluginProject = Project(id = "my-site", base = file(".")).
settings(
version := "0.1",
scalaVersion := Versions.scala,
ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) },
libraryDependencies += "be.doeraene" %%% "scalajs-jquery" % "0.9.0" exclude("org.webjars","jquery"),
libraryDependencies += "com.lihaoyi" %%% "upickle" % Versions.upickle,
libraryDependencies += "com.lihaoyi" %%% "scalatags" % Versions.scalaTags,
// we will not use use DOM directly so commenting it
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % Versions.dom,
jsDependencies += "org.webjars" % "jquery" % Versions.jquery / "jquery.js",
jsDependencies += "org.webjars.bower" % "jquery-ui" % Versions.jqueryUI / "draggable.js",
jsDependencies += "org.webjars.bower" % "webcomponents.js" % Versions.webcomponents / "webcomponents-lite.js",
skip in packageJSDependencies := false,
jsDependencies += RuntimeDOM,
scalaJSUseRhino in Global := false ) .enablePlugins(ScalaJSPlugin)}
どこ
val dom = "0.9.0"
val upickle = "0.4.0"
val jquery = "2.2.3"
val jqueryUI = "1.11.4"
val webcomponents = "0.7.21"
更新 2 - "2.2.3/jquery.js" + dependsON
jsDependencies += "org.webjars" % "jquery" % Versions.jquery / "2.2.3/jquery.js",
jsDependencies += "org.webjars.bower" % "jquery-ui" % Versions.jqueryUI / "core.js" dependsOn "META-INF/resources/webjars/jquery/2.2.3/jquery.js",
それで:
[error] Possible paths found on the classpath:
[error] - META-INF/resources/webjars/jquery-ui/1.11.4/ui/core.js
[error] - META-INF/resources/webjars/jquery/3.0.0-beta1/src/core.js
更新 3 - 「1.11.4/core.js」
jsDependencies += "org.webjars.bower" % "jquery-ui" % Versions.jqueryUI / "1.11.4/core.js" dependsOn "META-INF/resources/webjars/jquery/2.2.3/jquery.js",
それから:
[error] (compile:resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved: [error] - Missing JS library:
1.11.4/core.js
アップデート:
web-jar pom.xml から、
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>1.11.1</version>
</dependency>
</dependencies>
jquery 2.2.3に依存するとは思いません...
--
ユーザーとしては、成熟するまで数年かかると思います。