playframework - Play 2.4, Webjars not able to locate bootstrap -
i'm attempting use play webjars helper according documentation here load bootstrap: http://www.webjars.org/documentation
however when requesting page i'm getting following exception:
[illegalargumentexception: css/bootstrap.min.css not found. make sure you've added corresponding webjar , please check typos.]
build.sbt
librarydependencies ++= seq( ... "org.webjars" %% "webjars-play" % "2.4.0-1", "org.webjars" % "bootstrap" % "3.3.4", ... )
routes
#webjars wrapper /webjars/*file controllers.webjarassets.at(file)
html
... <link rel='stylesheet' href='@routes.webjarassets.at(webjarassets.locate("css/bootstrap.min.css"))'> ...
this same html file uses webjars wrapper locate require.min.js, works without problem.
<script data-main="@routes.assets.versioned("javascripts/main.js")" src="@routes.webjarassets.at(webjarassets.locate("require.min.js"))"></script>
if instead load bootstrap using plays reverse routing so, works:
<link rel='stylesheet' href='@routes.assets.versioned("lib/bootstrap/css/bootstrap.min.css")'>
any ideas why webjars helper unable load bootstrap, able load require.min.js?
the easiest solution seems to ditch webjars wrapper altogether, not seem make easier or more readable when loading resources.
Comments
Post a Comment