1

I'd like to use sbt-web to process my client-side assets. I have some source files that are going to be fed into sbt-web, and sbt-web is going to output some distribution files.

Is there a way to tell Play framework to exclude these source files (e.g. unminified javascript, etc) from the deployment build when building for production?

jyoung
  • 192
  • 2
  • 12

1 Answers1

4

Sbt-filter is what you are looking for. You can follow description at the Github page but basically you have to enable the plugin in your build.sbt, add it to the pipeline and write filter configuration.

lazy val root = (project in file(".")).enablePlugins(SbtWeb)

pipelineStages := Seq(filter)

For example to exclude a unminified javascripts you use:

includeFilter in filter := "*.js"

excludeFilter in filter := "*.min.js"
Daniel Olszewski
  • 12,152
  • 4
  • 52
  • 58
  • Just to add up, you have to enable the **sbt-filter** plugin in your `project/plugins.sbt` first, by adding this line `addSbtPlugin("com.slidingautonomy.sbt" % "sbt-filter" % "1.0.1")`, or else the `filter` symbol will be unresolved in your `build.sbt`. – mj3c Oct 01 '18 at 09:33