2

Using PlayFramework 2.3.1, sbt-web, Scala 2.11.

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

Lunigorn
  • 1,340
  • 3
  • 19
  • 27

1 Answers1

2

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",
Reid Spencer
  • 2,776
  • 28
  • 37
  • cannot resolve `public in Assets` and the `WebKeys` package – LoranceChen Mar 16 '17 at 06:34
  • 1
    Yes, I'm sure.`WebKeys` can't be resolved.Console output `object WebKeys is not a member of package com.typesafe.sbt.web import com.typesafe.sbt.web.WebKeys.public`.My project is based on [play starter project](https://github.com/playframework/play-scala) and it almost not change SBT config. – LoranceChen Mar 21 '17 at 03:23
  • 1
    @LoranceChen - This question was referencing PlayFramework 2.3.1. The starter project is for PlayFramework 2.5.13. There is likely a difference in the web plugin between versions. Have a look around the the com.typesafe.sbt.web package to see where the "public" key went. – Reid Spencer Mar 22 '17 at 14:58
  • @LoranceChen: It is now [`import com.typesafe.sbt.web.Import.WebKeys.public`](https://github.com/sbt/sbt-web/blob/9b0ea5ea2a2ad0a76898bf7164e49ee733076e26/src/main/scala/com/typesafe/sbt/web/SbtWeb.scala) – bluenote10 Apr 14 '17 at 09:44
  • @bluenote10 - Thanks, was that for Play 2.6? when was the change made? – Reid Spencer Apr 14 '17 at 16:19
  • @ReidSpencer I don't know exactly, just checked the current version which is 2.5 btw. – bluenote10 Apr 14 '17 at 16:26