According to the documentation here: https://github.com/playframework/Play20/wiki/AssetsGoogleClosureCompiler says:
Any JavaScript file present in the application / assets will be analyzed by the Google Closure compiler, checked for errors and dependencies, and will be reduced if it is activated in the assembly configuration.
However, I canβt find out how to install this in the build configuration, I tried adding the code:
val main = PlayProject(appName, appVersion, mainLang = SCALA).settings( javascriptEntryPoints <<= baseDirectory(base => base / "app" / "assets" / "javascripts" ** "*.js" ) )
in build.scala, however I cannot find mini JavaScript files.
Here are the steps I tried:
Add the above code to build.scala
Create a JavaScript file in app / assets / javascripts
Type "compile" on the Play console and note that no javascript files are created in app / assets / javascripts or public / javascripts.
However, I noticed that if I write some kind of invalid JavaScript, I will get an error message (for example, at 127.0.0.1:9000 - Compilation error), so it looks like the closing compiler checks for errors successfully, m not sure how perform minimization.
While on the issue of minimization, is it possible to use a regular (non-minified) JavaScript file only in development mode, but use the mini version during production?
thanks
source share