JavaScriptMinify has no options

There are no properties on the JavaScriptMinify task to pass options to the Google Closure compiler. Unfortunately, our Javascript code does not compile with the default options.

1 Like

Yes, there was a conscious decision to only provide basic javascript support as our observation was that most teams use a custom asset processing pipeline anyways. There is a sample that demonstrates hooking custom assets into the binary if you want an example.

Having said that, which options are you looking to set?

In our case, --language_in (Sets what language spec that input sources conform.) is important. It would be great if we could specify an “args” option (List of Strings). This could then be transformed to a CompileOptions object using the createOptions method of the CommandLineRunner class: https://github.com/google/closure-compiler/blob/75315308ca3c80922a1ad60df4cc3bd19e655d17/src/com/google/javascript/jscomp/CommandLineRunner.java

I understand that complex javascript pipelines are out of scope for Gradle core, but having no configurations options at all to pass to a compiler seems to be a bit minimalistic :wink:

1 Like