SbtWeb: uglify the output of traceur

156 views Asked by At

I'm using the SbtWeb traceur plugin to transpile my code in a Play Framework (sbt/scala) project. This gives me an ES5 resource at /main.js. I want to then uglify the result into /main.min.js. I added the uglify plugin as well, and then tried to do the following:

pipelineStages := Seq(traceur, uglify)

Unfortunately this doesn't compile, as traceur is a TaskKey, but not of the correct type. How can I do this?

Edit: It appears a closer-to-correct way to do this is like this:

pipelineStages in Assets := Seq(uglify)
includeFilter in uglify := GlobFilter("main.js")

However, I now get uglify errors that there are syntax errors in the Javascript. This has to be because uglify is trying to process the original ES6 sources, rather than the ES5 output of traceur. No idea how to get this to work yet.

0

There are 0 answers