//Minified Version, compresses and variables renamed
task minified_version(type: com.eriwen.gradle.js.tasks.MinifyJsTask) {
def x = new com.google.javascript.jscomp.CompilerOptions()
x.setPrettyPrint(false)
source = file("${buildDir}/input.js")
dest = file("${buildDir}/minified.js")
closure {
compilationLevel = 'SIMPLE_OPTIMIZATIONS'
warningLevel = 'QUIET'
compilerOptions = x
}
}
Then, if I run any of the above tasks, they will produce a output file with the same content (and different name: minified.js or debug.js), which will be the "Minified" version. It seems that all the MinifyJsTask tasks will keep the configuration of the task which is at the very bottom. I know this because when I removed minified_version task, I was able to run debug_version task and I obtained the debug file that I want to obtain running this task.
Is this supposed to work like this? Am I doing it in a wrong way? Do you have any suggestions?
I have a js file and I want to have 2 more.
So, I created two tasks willing to achieve this:
Then, if I run any of the above tasks, they will produce a output file with the same content (and different name: minified.js or debug.js), which will be the "Minified" version. It seems that all the MinifyJsTask tasks will keep the configuration of the task which is at the very bottom. I know this because when I removed minified_version task, I was able to run debug_version task and I obtained the debug file that I want to obtain running this task.
Is this supposed to work like this? Am I doing it in a wrong way? Do you have any suggestions?