I'm having an issue when trying to use the sbt-uglify plugin. I've configured the project per: https://github.com/sbt/sbt-uglify
in plugins.sbt:
addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "1.0.3")
in build.sbt:
pipelineStages := Seq(uglify, digest, gzip)
I have a non-trivial number of JS files (60+). What I've been getting is an OutOfMemory exception which prevents me from being able to complete a dist
command.
Has anyone else encountered this problem? Any ideas/solutions are appreciated.
(NOTE: I've tried bumping up my SBT_OPTS without success already).
Thanks!
I suppose you really are running out of memory. I don't know whether or not the plugin is cuasing it, but you can limit the memory Java asks for.
Have you tried setting the
Xmx
orXms
options for Java?If you know your memory limit on your machine, you can easily set those options. Let's just say you have 1GB of memory available, we'll set the max heap size for Java to 512MB, temporarily using
_JAVA_OPTIONS
, which is picked up by Play Framework:Then you can try running the
dist
command. It should immediately print out that the Java Options were picked up.