yshrsmz / BuildKonfig

BuildConfig for Kotlin Multiplatform Project
Apache License 2.0
769 stars 32 forks source link

Add option to disable @JsExport #147

Closed MohamedRejeb closed 3 months ago

MohamedRejeb commented 5 months ago

Hi, Currently, Kotlin 2.0.0-RC2 has an issue with exporting expect/actual objects to javascript and this issue is affecting BuildKonfig, hopefully it will be fixed in the next release, but I think it's better to be able to disable exporting the generated config object to javascript. Not everyone needs it.

https://youtrack.jetbrains.com/issue/KT-67978

Thanks!

yshrsmz commented 5 months ago

BuildKonfig adds JsExport annotation if you have a JavaScript target.

https://github.com/yshrsmz/BuildKonfig/blob/727f4f9e79e6726ab9489499ec6d92b6f6d56266/buildkonfig-compiler/src/main/kotlin/com/codingfeline/buildkonfig/compiler/generator/BuildKonfigGenerator.kt#L53

So, we'll add an option if the issue won't make it to the stable release.

MohamedRejeb commented 5 months ago

The issue should be fixed in RC3, I'll check try it.

yshrsmz commented 3 months ago

I'm closing this for now. Please let me know if you still see this error.

MohamedRejeb commented 3 months ago

They fixed it in Kotlin 2.0.0-RC3, it's working fine now.