Javascript 在使用Google Closure编译器和Grunt JS时禁用report.txt的创建

Javascript 在使用Google Closure编译器和Grunt JS时禁用report.txt的创建,javascript,obfuscation,google-closure-compiler,gruntjs,Javascript,Obfuscation,Google Closure Compiler,Gruntjs,为了缩小和模糊我的JS代码,我尝试使用Grunt的插件 我对结果非常满意,但是在运行Grunt之后,我在输出目录中得到了project.min.js.report.txt文件。我还没有找到任何人对此负责 我看到的唯一解决方案是创建另一个任务来删除该文件。是否有更简单的方法避免此文件再次出现 以下是我的Grunfile.js内容: module.exports = function(grunt) { grunt.initConfig({ "concat": {

为了缩小和模糊我的JS代码,我尝试使用Grunt的插件

我对结果非常满意,但是在运行Grunt之后,我在输出目录中得到了
project.min.js.report.txt
文件。我还没有找到任何人对此负责

我看到的唯一解决方案是创建另一个任务来删除该文件。是否有更简单的方法避免此文件再次出现

以下是我的Grunfile.js内容:

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"]);
};

你不能像现在这样做。

有趣的是,只是这个,而不是谷歌闭包编译器


为此创建了一个问题。

现在可以使用
noreport
选项():

'closure-compiler': {
    frontend: {
        closurePath: '/var/www/closure/',
        js: 'js/file.js',
        jsOutputFile: 'js/dist/file.min.js',
        maxBuffer: 500,
        options: {
            compilation_level: 'SIMPLE_OPTIMIZATIONS',
            noreport: true
        }
    }
}