Name mangling for Kotlin/JS

Is there a plugin or something else that makes it possible to mangle names of functions, classes and properties?

Webpack can do this with plugins like terser-webpack-plugin, but due to the dynamic nature of JavaScript, where every property can be referenced by a string, it doesn’t work for properties without some serious hoop jumping.

However, Kotlin is static so maybe there is a tool in the Kotlin ecosystem?

The reason I ask in the JavaScript section is that this question doesn’t really make sense in JVM land.

It depends on what do you mean by mangling. There are @JVMName and @JSName annotations which allow to change platform names. Also JS plugin automatically mangles some names. If you need some kind of obfuscation, the simplest thing to do is to run webpack obfuscation on bundle.

The problem is that name mangling doesn’t work for names in “top level”/“global scope” due to the dynamic nature of Java Script. Surprisingly even when I have split my code apart from libraries.
Hence I hoped Kotlin might have something.