Node.js Nodejs咕噜声模糊

Node.js Nodejs咕噜声模糊,node.js,obfuscation,Node.js,Obfuscation,我正在使用Nodejs-grunt模块。我知道grunt min选项可以缩小文件。但现在我需要像谷歌闭包编译器一样混淆文件。grunt有这个功能吗?grunt min任务允许您设置UglifyJS(grunt min工具)选项,这可以让您更好地控制目标文件的损坏和压缩方式 从grunt任务\u min文档: Specifying UglifyJS options In this example, custom UglifyJS mangle, squeeze and codegen opt

我正在使用Nodejs-grunt模块。我知道grunt min选项可以缩小文件。但现在我需要像谷歌闭包编译器一样混淆文件。grunt有这个功能吗?

grunt min任务允许您设置UglifyJS(grunt min工具)选项,这可以让您更好地控制目标文件的损坏和压缩方式

从grunt任务\u min文档:

Specifying UglifyJS options

In this example, custom UglifyJS mangle, squeeze and codegen options are
specified. The listed methods and their expected options are explained in
the API section of the UglifyJS documentation:

The mangle object is passed into the pro.ast_mangle method.
The squeeze object is passed into the pro.ast_squeeze method.
The codegen object is passed into the pro.gen_code method.

// Project configuration.
grunt.initConfig({
  min: {
    dist: {
      src: ['dist/built.js'],
      dest: 'dist/built.min.js'
    }
  },
  uglify: {
    mangle: {toplevel: true},
    squeeze: {dead_code: false},
    codegen: {quote_keys: true}
  }
});