How can I prevent my Kotlin classes getting rename...
# javascript
b
How can I prevent my Kotlin classes getting renamed in JS when executing the
browserProductionWebpack
build?
1
a
Have you tried the
@JsName("NameOfMyFunction")
decorator ?
b
Yep. Without luck. the compiled
site.js
didn’t even change, when I added
JsName
a
Ok so just to clarify, you have added your
@JsExport
on your class and the
@JsName
on your function, but nothing ? (in my case the js class name is well the same as in my kotlin code, so for sure you can prevent it)
b
I don’t have
@JsExport
Only
@JsName
. I am not trying to call Kotlin from Javascript. I am doing this:
MyClass::class.js.name
Let’s assume MyClass is nested in
MyOtherClass
. In the dev build I get
MyOtherClass$MyClass
In the prod build I get
x$y
And both are annotated with
@JsName("blabla")
t
Webpack configuration required Also you can disable renaming at all
👍 1
b
that did the trick. Thank you very much!
🙂 1