我尝试使用[ScalablyTyped] [1]开始一个项目。
启动sbt
时出现以下异常:
error: not found: value npmDependencies
npmDependency在编译++ = Seq(“ d3”->“ 5.5.0”)
这是我的plugin.sbt
:
resolvers += Resolver.bintrayRepo("oyvindberg", "ScalablyTyped")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.26")
addSbtPlugin("org.scalablytyped" % "sbt-scalablytyped" % "201904160530")
和我的Builod.sbt:
enablePlugins(ScalaJSPlugin)
name := "Scala.js Tutorial"
scalaVersion := "2.12.6"
resolvers += Resolver.bintrayRepo("oyvindberg", "ScalablyTyped")
libraryDependencies ++= Seq(ScalablyTyped.D.d3)
npmDependencies in Compile ++= Seq("d3" -> "5.5.0")
答案 0 :(得分:1)
npmDependencies
是scalajs-bundler提供的密钥,因此在project/plugins.sbt
中需要以下行:
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.14.0")
和build.sbt
enablePlugins(ScalaJSBundlerPlugin)