scalaplayframeworkplayframework-2.3sbt-web

How to change destination folder of compiled assets in PlayFramework 2.3.1?


Using PlayFramework 2.3.1, sbt-web, Scala 2.11.

How to change destination folder of compiled assets form "public" to "pub" for example?


Solution

  • There are a pair of settings that you should modify for this. For example, to set it to "pub", you would do this:

    import com.typesafe.sbt.web.Import.WebKeys.public // For Play 2.5.x
    import com.typesafe.sbt.web.WebKeys.public // For Play 2.3.x
    
    public in Assets := webTarget.value / "pub" / "main",
    
    public in TestAssets := webTarget.value / "pub" / "test",