Is it possible to export the Typescript classes wi...
# javascript
w
Is it possible to export the Typescript classes without full package name from my Kotlin code? except declare those files in root package
plus one 5
b
I'm affraid not.
t
If your classes located in single package - you can use library.export webpack configuration for JS distribution
If you use generated TS definitions - they can be fixed by Gradle plugin
😮 2
g
@turansky do you have a link to share? I don't find the documentation about this option in the gradle plugin.
t
Oh… It’s about custom Gradle plugin
b
Or just custom task to rewrite generated files and adjust the namespace
t
👌 2
s
Kinda bringing this up from the dead, but do you have an example of a project which has implemented this custom plugin in their repository? This is probably my inexperience with making custom gradle plugins, but I am basically not able to resolve
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
while writing the plugin. What would I need to have in the build.gradle.kts file of it to be able to resolve this? Currently have started with a diff like this but I am in super unknown waters for me, and it doesn’t help that every single resource I can find online for custom plugins is using groovy and I can’t make sense of it really 😄
t
s
Hey thanks, that does resolve
Kotlin2JsCompile
! Now I am trying to put this plugin inside my project repo, and somehow have my project use this plugin. Do you have a sample project that does just that? Again googling around for problems that I have little understanding of prove to be insanely difficult unfortunately 😕 To my understanding I shouldn’t have to dabble in any of the ivy/mavenLocal etc. things to use my plugin locally, and my
gradlePlugin {}
declaration should suffice but I can’t quite get it to work
t
If your plugin is local - you can declare it in
buildSrc
with less overhead
Like here