How to obfuscate ES6 class method names using Webpack/Babel/UglifyJS

Viewed 1961

I have ES7 code that I am compiling to ES5 (using Webpack/Babel/UglifyJS). I want to obfuscate the code as much as possible.

Babel uses a key/value object for classes, which preserves the name of the functions:

enter image description here

Is there a tool that obfuscates ES6 class names and methods?

I am looking for this transformation:

ES6 -> Obfuscated ES6 (esp classes)

My code is compiled to a single bundle, and the classes are not used externally outside of the bundle.

Current tools I am aware of:

  • Babili (does not do this).
  • UglifyJS (takes ES5 as input).
1 Answers
Related