Kotlin / kotlin-frontend-plugin

Gradle Kotlin (http://kotlinlang.org) plugin for frontend development
Apache License 2.0
561 stars 69 forks source link

Does it work with new kotlin-multiplatform plugin? #117

Closed felipecsl closed 5 years ago

felipecsl commented 5 years ago

I've been trying to use this plugin with the new kotlin MPP kotlin-multiplatform but it doesn't seem to work correctly. More specifically the webpack bundle is never built. After digging into why, it seems like this plugin depends explicitly on the kotlin2js plugin, which doesn't seem to be either needed nor work with kotlinmultiplatform. I get an error like "kotlin extension is already defined". It seems like this just needs to be made more generic so that it doesn't explicitly require kotlin2js. Does that make sense? The new JS compile task apparently is called compileKotlinJs (previously called compileKotlin2Js), so we could just look for either one of those tasks being present. If that makes sense I can take a stab at making those changes.

Thanks!

adam-arold commented 5 years ago

This would be great! 👍 Right now I can't use the kotlin-dce-js either and webpack can't build the bundle so I have to reference the js files one-by one which is cumbersome and I also can't use this in production because the js files are not minified / tree shaked so they take up 1+ MB.

snrostov commented 5 years ago

kotlin-frontend-plugin 0.0.44 with new multiplatform support was released. See example here: https://github.com/Kotlin/kotlin-frontend-plugin/tree/master/examples/new-mpp