Search code examples
playframeworkwebjarsscala-template

Why WebJars are not extracted into a lib folder


According to the documentation,webjars are automatically extracted by Play into a lib folder relative to the our public assets, but after installing bootstrap from webjars, I still have no lib folder. No lib folder under /public, no lib folder under /target.

I am having this compilation error:

not found: value lib
<link rel="stylesheet" href="@routes.Assets.at(lib/bootstrap/css/bootstrap.css)">

I am certainly doing something wrong.

This is my routes file:

GET     /                           controllers.HomeController.index

GET     /assets/*file               controllers.Assets.at(path="/public", file)

This is my build.sbt file:

name := "contact-manager"

version := "0.1"

scalaVersion := "2.12.8"

libraryDependencies ++= Seq(
  guice,
  "org.webjars" % "bootstrap" % "3.3.6",
  "org.webjars" % "jquery" % "3.3.1"
)

enablePlugins(PlayScala)

Any idea ?


Solution

  • You are missing qoutes around lib/bootstrap/..., since Assets.at() takes a string as argument. In your code lib is a variable and thus comes the message not found: value lib.