Exclude files from Play framework production build

1.1k views Asked by At

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?

1

There are 1 answers

2
Daniel Olszewski On BEST ANSWER

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"