title: Play Framework template that is actually a JS file
body: <p>I'd like to have a Play template that is a JS file (as opposed to having <code>&lt;script&gt;</code> tags inside an HTML template). The reason for this is so that the script can be cached. However, I need to create a differences in the script depending on where it's included and hoped to do this with Play's template system. I can already do so if I use embedded scripts, but those can't be cached.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/15763655/dynamic-javascript-using-scala-template">an existing question</a> that also asks the same thing, but the answer is totally different (different goals).</p>