To minify and obfuscate my JS code I'm trying to use Grunt's closure-compiler plugin.
I'm perfectly happy with the result, but after running Grunt I get project.min.js.report.txt
file in the output directory. I haven't found any options responsible for that.
The only solution I see is to create another task to remove the file. Are there simplier ways to avoid this file from reappearing?
Here is my gruntfile.js contents:
module.exports = function(grunt) {
grunt.initConfig({
"concat": {
js: {
src: [
"js/project.js"
],
dest: "js/project.all.js"
}
},
"closure-compiler": {
frontend: {
closurePath: "path/to/gcc_jar_directory",
js: "js/project.all.js",
jsOutputFile: "js/project.min.js",
maxBuffer: 500,
options: {
compilation_level: "ADVANCED_OPTIMIZATIONS",
language_in: "ECMASCRIPT5_STRICT",
}
}
},
watch: {
js: {
files: ["js/project.js"],
tasks: ["concat:js", "closure-compiler"]
}
}
});
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-closure-compiler");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.registerTask("default", ["concat:js", "closure-compiler", "watch"]);
};