diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-17 15:12:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-17 15:12:22 +0800 |
commit | cff3bf49142e5d99ad07e182169a73f985b7b652 (patch) | |
tree | a324727ea24c7e82937e858aa1b1d1109361e393 /bin | |
parent | 79cfac77bdee04021db9f60111f55005919f7b67 (diff) | |
download | tracifyjs-cff3bf49142e5d99ad07e182169a73f985b7b652.tar.gz tracifyjs-cff3bf49142e5d99ad07e182169a73f985b7b652.zip |
configure `rename` with CLI (#2802)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/uglifyjs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/uglifyjs b/bin/uglifyjs index 9a3257e7..2ff1feb7 100755 --- a/bin/uglifyjs +++ b/bin/uglifyjs @@ -43,6 +43,7 @@ program.option("-d, --define <expr>[=value]", "Global definitions.", parse_js("d program.option("--ie8", "Support non-standard Internet Explorer 8."); program.option("--keep-fnames", "Do not mangle/drop function names. Useful for code relying on Function.prototype.name."); program.option("--name-cache <file>", "File to hold mangled name mappings."); +program.option("--rename", "Force symbol expansion."); program.option("--no-rename", "Disable symbol expansion."); program.option("--self", "Build UglifyJS as a library (implies --wrap UglifyJS)"); program.option("--source-map [options]", "Enable source map/specify source map options.", parse_source_map()); @@ -62,13 +63,11 @@ if (!program.output && program.sourceMap && program.sourceMap.url != "inline") { "compress", "ie8", "mangle", - "rename", "sourceMap", "toplevel", "wrap" ].forEach(function(name) { if (name in program) { - if (name == "rename" && program[name]) return; options[name] = program[name]; } }); @@ -121,6 +120,11 @@ if (program.parse) { fatal("ERROR: inline source map only works with built-in parser"); } } +if (~program.rawArgs.indexOf("--rename")) { + options.rename = true; +} else if (!program.rename) { + options.rename = false; +} var convert_path = function(name) { return name; }; |