it has the same effect as specifying `pure_funcs` in `--compressor`
option, however it's much easier to use
instead of:
--compressor 'pure_func=["Math.floor","debug","console.logTime"]'
it's now possible:
--compressor --pure-funcs Math.floor debug console.logTime
fixes #684
--mangle-props Mangle property names
--mangle-regex Only mangle property names matching the regex
--name-cache File to hold mangled names mappings
+ --pure-funcs List of functions that can be safely removed if
+ their return value is not used [array]
```
Specify `--output` (`-o`) to declare the output file. Otherwise the output
.describe("mangle-props", "Mangle property names")
.describe("mangle-regex", "Only mangle property names matching the regex")
.describe("name-cache", "File to hold mangled names mappings")
+ .describe("pure-funcs", "List of functions that can be safely removed if their return value is not used")
.alias("p", "prefix")
.alias("o", "output")
.string("prefix")
.string("name-cache")
.array("reserved-file")
+ .array("pure-funcs")
.boolean("expr")
.boolean("source-map-include-sources")
if (COMPRESS) COMPRESS.global_defs = getOptions("d");
}
+if (ARGS.pure_funcs) {
+ if (COMPRESS) COMPRESS.pure_funcs = ARGS.pure_funcs;
+}
+
if (ARGS.r) {
if (MANGLE) MANGLE.except = ARGS.r.replace(/^\s+|\s+$/g).split(/\s*,+\s*/);
}