- exportPublic
- jsIntegration
Latest Kotlin uses DCE to minimise JS module code size. Their suggestion is to add @JsExport annotation to all classes that you want to export. I don't like this. I think anything marked with public visibility should be exported. This plugin make that happen.
plugins {
id("net.akehurst.kotlin.gradle.plugin.exportPublic") version("<latest version>")
}
By default it exports all public declarations. To limit this add some configuration
exportPublic {
exportPatterns.set(
listOf(
"<qualified name glob>",
"some.package.name.**"
)
)
}
This is a kotlin compiler plugin, published as a gradle-plugin, thus the gradlePluginPortal must be added as a repository in order for dependencies to be resolved.
repositories {
mavenCentral()
gradlePluginPortal()
...
}