0

I want to use Simple Optimization from Google Closure in Play! (using Scala)

I searched a while now for solutions to do that.

First thing I found is to put following in Build.scala:

val main = play.Project(appName, appVersion, appDependencies).settings(
  closureCompilerOptions += "advancedOptimizations"
)

But somehow the advanced Optimizer is killing my JS completely. It even "optimizes" document.getElementsByTagName() to a.a()...

So I searched a little bit more and found another approach:

val defaultOptions = new CompilerOptions()
defaultOptions.closurePass = false
CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(defaultOptions)
defaultOptions.setProcessCommonJSModules(false)
defaultOptions.setManageClosureDependencies(false)

val main = play.Project(appName, appVersion, appDependencies).settings(
  closureCompilerSettings(defaultOptions) : _* // ++
)

This is doing exactly what a want, but with a big down side, which is a no-go in my case. It combines all Javascript files.

Does anybody has a Idea how I can disable the JS merge? It doesn't do the merge in the first approach, only for the second. And I don't have a clue why.

attrib
  • 121
  • 1
  • 10

0 Answers0