4

I have an issue with the sbt-concat plugin I use to group all my JS file in assets/javascripts. The problem is that it's not group in the right order.

Basically, my tree looks like this :

-assets
--javascripts
---dashboard
----controller.js
---app.js

And the created file thanks to sbt-concat loads controller.js before app.js which obviously make the controller crash.

Here is my plugin.sbt :

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "1.0.3")

addSbtPlugin("net.ground5hark.sbt" % "sbt-concat" % "0.1.8")

and my build.sbt :

Concat.groups := Seq(
    "scripts.js" -> group(((sourceDirectory in Assets).value / "javascripts") ** "*.js")
)

Concat.parentDir := "javascripts"

includeFilter in uglify := GlobFilter("scripts.js")

pipelineStages in Assets := Seq(concat, uglify, digest, gzip)

So everything works fine, except that the app.js isn't load at first, it's the only one I need to be loaded first, if any of you has an idea just for that, it would be awesome ! Thanks :D

Guigui
  • 601
  • 1
  • 8
  • 19

0 Answers0