babel / minify

:scissors: An ES6+ aware minifier based on the Babel toolchain (beta)
https://babeljs.io/repl
MIT License
4.39k stars 225 forks source link

Support specifying which propertie names to mangle #358

Open hh9527 opened 7 years ago

hh9527 commented 7 years ago

uglifyjs support this feature.

user can set a pattern like /^_/ to let properties prefixed by underscore to be mangled.

hzlmn commented 7 years ago

@boopathi Hi, Is this still active, if so can i look on it? Should it support UglifyJS like style of passing mange props ?

 --mangle-props                Mangle property names (default `0`). Set to
                                `true` or `1` to mangle all property names. Set
                                to `unquoted` or `2` to only mangle unquoted
                                property names. Mode `2` also enables the
                                `keep_quoted_props` beautifier option to
                                preserve the quotes around property names and
                                disables the `properties` compressor option to
                                prevent rewriting quoted properties with dot
                                notation. You can override these by setting
                                them explicitly on the command line.
  --mangle-regex                Only mangle property names matching the regex
haraldF commented 7 years ago

+1 for a mangle-regex, would be great to have that.

gauntface commented 7 years ago

Another +1 for this.