UglifyJS property mangling

According to the docs, UglifyJS can cripple all property names except those listed in the reserved list. Is it possible to do it differently, so that only the properties in the provided list will be distorted?

If so, what parameters do I need to pass to uglify.minify(files, { ... }) ?

+6
javascript uglifyjs uglifyjs2
Jun 15 '15 at 8:47
source share
1 answer

One (ugly) command line approach to achieve the white list you are looking for may be to use the regex option.

You can also use a regular expression to determine which property names should be garbled. For example, --mangle-regex = "/ ^ _ /" will only manipulate property names starting with an underscore.

UglifyJS2 Readme

Otherwise, there is an open problem that provides code that you could use to modify uglify yourself, which achieves what I think you're looking for.

+8
Jun 28 '15 at 21:28
source share



All Articles