Is it possible to mark certain classes / functions to be excluded from DCE?
I'm trying to build a KotlinJS library that will be consumed by handwritten JavaScript and unless i specifically console.log that class, it gets removed by DCE
Copy code
@JsName("RoomState")
data class RoomState(
val numberOfRooms: Int
)
Copy code
fun main() {
console.log(RoomState::class)
}
which now allows me to do
Copy code
this.projectname.RoomState()
in pure JS, i exclude that console.log, RoomState is not available
that's awesome, let me experiment and see if it can handle wildcards, then i can just put the package in
janvladimirmostert
06/06/2020, 1:53 PM
seems like i need to do it for every single class that i'm exposing to the JS side, mmm, wonder if it can be achieved with a @NonDCE annotation or something
janvladimirmostert
06/06/2020, 2:11 PM
Thanks for the help, this is getting me in the right direction