I
I
Ivan Smirnov2015-02-17 15:11:36
Scala
Ivan Smirnov, 2015-02-17 15:11:36

Are there standard methods to parameterize files when building SBT?

There is a project, scala, play framework. Going SBT.
Faced with the problem that the java script is periodically cached, and because of this, when moving to a new version, it does not work until you clear the cache.
I would like to customize the templates when assembling.

<script src="script.js?nocache=%script.js.version%">

Is there any way to replace %script.js.version% with the hash of the script when building an SBT project?
Of course, I don't want to write a script that does this. Maybe there are already some solutions?
Google gave no answers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2015-02-17
@StopKran

Try like this

GET    /assets/*file    controllers.Assets.versioned(path="/public", file: Asset)

and like this
<link rel="stylesheet" href="@routes.Assets.versioned("path/to/assets.css")">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question