https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

Shannon Rhodes

03/05/2021, 8:53 PM
for targeting JS, do I have to use the @JsModule within my Kotlin code? when I compile using ./gradlew compileProductionExecutableKotlinJs my code only gives me the general JS functionality (objects, arrays, etc) not my actual module that I wrote in Kotlin.
a

ankushg

03/05/2021, 9:18 PM
Is DCE perhaps removing your stuff? If you're using the new IR, you might need to annotate with
@JsExport
or with legacy, configure the DCE (and maybe use
@JsName
)? https://kotlinlang.org/docs/javascript-dce.html#exclude-declarations-from-dce
s

Shannon Rhodes

03/05/2021, 9:37 PM
do you have a specific example of how to implement JsExport and JsName within kotlin?
I'm using this DSL:
Copy code
implementation(kotlin("stdlib-js"))
                implementation("io.ktor:ktor-client-js:$ktorVersion")