(An example project is given) I canβt get sbt-concat work designed to find and concatenate stylesheets that arise due to styles that may arise from preprocessor tasks. In my working application, I'm trying to use it to combine selected output files from sbt-sass . It does not work in the complex setup of this project, so I created a sample project to see if I can make it work at all. It also does not work in the sample project. Here is a build.sbt test project that tries to create several packages, with almost every opportunity I can think of, just see if any of them work ( public Github repo , which you should be able to clone and replicate the problem immediately) :
import com.typesafe.sbt.web.Import.WebKeys._ import com.typesafe.sbt.web.pipeline.Pipeline name := """sbt-concat-test""" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayScala, SbtWeb) scalaVersion := "2.11.1" libraryDependencies ++= Seq( jdbc, anorm, cache, ws ) resolvers += Resolver.sonatypeRepo("releases") includeFilter in (Assets, LessKeys.less) := "*.less" excludeFilter in (Assets, LessKeys.less) := "_*.less" val myPipelineTask = taskKey[Pipeline.Stage]("Some pipeline task") myPipelineTask := { mappings => println(mappings); mappings } pipelineStages := Seq(myPipelineTask, concat) Concat.groups := Seq( "style-group1.css" -> group(sourceDirectory.value ** "*.css"), "style-group2.css" -> group(baseDirectory.value ** "*.css"), "style-group3.css" -> group((sourceDirectory in Assets).value ** "*.css"), "style-group4.css" -> group(target.value ** "*.css"), "style-group5.css" -> group(Seq("core.css", "styles/core.css", "assets/styles/core.css", "app/assets/styles/core.css")), "style-group6.css" -> group(Seq("lessStyle.css", "ui/lessStyle.css", "styles/ui/lessStyle.css", "assets/styles/ui/lessStyle.css", "app/assets/styles/ui/lessStyle.css")), "style-group7.css" -> group(Seq("sassStyle.css", "ui/sassStyle.css", "styles/ui/sassStyle.css", "assets/styles/ui/sassStyle.css", "app/assets/styles/ui/sassStyle.css")), "style-group8.css" -> group(Seq("**/*.css")) )
I run ; clean; reload; stage ; clean; reload; stage ; clean; reload; stage from activator for testing. I see source files copied to the target folder with the following results for declared packages:
- style-group1.css does not exist
- style-group2.css contains the contents of
button.css and core.css - style-group3.css contains the contents of
core.css and button.css - style-group4.css does not exist
- style-group5.css contains only the contents of
core.css - style-group6.css contains only the contents of compiled
lessStyle.scss - style-group7.css contains only the contents of compiled
sassStyle.scss - style-group8.css does not exist
I do not understand why the 2nd and 3rd cases do not pick up the css files processed by the preprocessor, but the 6th and 7th cases made specially for this. Perhaps, in particular, the result of myPipelineTask shows PathMapping for all source files, as well as the resulting css and sourcemaps from Sass and Less tasks.