How to troubleshoot JS dependencies between webjars and scala-js jars in an SBT project?

故事扮演 提交于 2019-12-11 03:47:00

问题


I've been using scalajs-dom v 0.8.1 and trying to mix webjars within my SBT project. When I do this, I'm getting one final ambiguous JS reference that I can't figure out. I think it is between the webjars I want to use (that include jquery v 2.1.4) and scala-js. I tried using the ManifestFilters SBT filter but it does not seem to help (or I don't know the correct syntax). Does anyone have a useful way to debug these kinds of errors? (see below for SBT output when issuing the 'fastOptJS' task)

[error] - Ambiguous reference to a JS library: jquery.js
[error]   Possible paths found on the classpath:
[error]   - META-INF/resources/webjars/jquery/2.1.4/dist/jquery.js
[error]   - META-INF/resources/webjars/jquery/2.1.4/src/jquery.js
[error]   originating from: spJS:compile, spJS:compile

回答1:


Specifying the specific subpath for jquery.js should disambiguate when pulling down webjar dependencies.

jsDependencies += "org.webjars" % "jquery" % "2.1.4" / "dist/jquery.js"

see: https://github.com/scala-js/scala-js/issues/1496



来源:https://stackoverflow.com/questions/33169278/how-to-troubleshoot-js-dependencies-between-webjars-and-scala-js-jars-in-an-sbt

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