Versions:
- play 2.3.4
- sbt 0.13.1
- scala 2.11.2
I've followed the documentation on playframework.com to enable fingerprinting on public assets, but calls to routes.Assets.versioned
never produce a versioned filename with a digest hash.
Relevant lines in build.sbt:
scalaVersion := "2.11.2"
pipelineStages := Seq(rjs, digest)
Relevant lines in project/plugins.sbt:
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.5")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0")
Relevant lines in conf/routes:
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
And the main template:
@(title: String, lang: String, cssClasses: String, bodyContents: Html)
<!DOCTYPE html>
<html lang="@lang">
<head>
<meta charset="UTF-8">
<title>@title</title>
<script type="text/javascript" src="@routes.Assets.versioned("javascript/components/main.js")"></script>
</head>
<body>
<div class="layout @cssClasses">
@bodyContents
</div>
</body>
</html>
The output is always:
<!DOCTYPE html>
<html lang="el">
<head>
<meta charset="UTF-8">
<title>[title]</title>
<script type="text/javascript" src="/assets/javascript/components/main.js"></script>
</head>
<body>
...
</body>
</html>
I get no compiler errors. The fingerprinting just "doesn't work". I assume I am missing something simple, but I cannot see it.
Other notes:
- running
find . -name "*.js"
in the root of the project shows no files that have a digest appended to the beginning, as the documentation suggests - I've run
sbt clean dist
to generate a production mode release and the behavior is the same
Can anyone advise?
Thank you!
NB: I've started looking through the generated class in target/src_managed/main/routes_reverseRouting.scala
to debug the generated versioned
method, but this seems like overkill for something that is fairly straightforward.