admin管理员组文章数量:1335138
According to the docs, UglifyJS can mangle all property names except those on a provided reserved list. Is it possible to do it the other way, so only properties on provided list will be mangled?
If so, what options do I need to pass to uglify.minify(files, { ... })
?
According to the docs, UglifyJS can mangle all property names except those on a provided reserved list. Is it possible to do it the other way, so only properties on provided list will be mangled?
If so, what options do I need to pass to uglify.minify(files, { ... })
?
- 2 it seems such option is not supported so you would need to modify source code. – artur grzesiak Commented Jun 28, 2015 at 20:58
1 Answer
Reset to default 9 +50One (ugly) mand-line approach to achieve the kind of whitelist you're looking for might be to use the regex option.
You can also use a regular expression to define which property names should be mangled. For example, --mangle-regex="/^_/" will only mangle property names that start with an underscore.
UglifyJS2 Readme
Otherwise, there is an open issue which provides the code you could use to modify uglify yourself which achieves what I believe you're looking for.
本文标签: javascriptUglifyJS property manglingStack Overflow
版权声明:本文标题:javascript - UglifyJS property mangling - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742269897a2444105.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论