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

coletz

06/26/2019, 6:31 AM
I have a multiplatform project with kotlin js and I need to use kotlin 1.3.31. Right now intellij idea creates a configuration which uses kotlin 1.3.40 and some stuff which are not available before this version. I am talking about these: 1)
Copy code
kotlin{
  ...
   js {
    browser {
    }
  }
}
2)
Copy code
jvmBackendJar {
    dependsOn(jsBrowserWebpack)
    from(new File(jsBrowserWebpack.entry.name, jsBrowserWebpack.outputPath))
}
how can I replicate these tasks without kotlin 1.3.40? Can someone share an older mpp config with js? Thanks 🙂
h

h0tk3y

06/26/2019, 1:27 PM
Running webpack was not supported in the Kotlin Gradle plugin in any way before 1.3.40. However, we had a separate
kotlin-frontend
plugin that could run webpack. You can try it: https://github.com/Kotlin/kotlin-frontend-plugin
c

coletz

06/29/2019, 3:56 PM
I tried applying the plugin and got some issue:
apply plugin: 'org.jetbrains.kotlin.frontend'
apply plugin: 'kotlin2js'
And got the error
Cannot add extension with name 'kotlin', as there is an extension already registered with that name.
So i removed the kotlin2js plugin and got this issue:
The 'java' plugin has been applied, but it is not compatible with the Android plugins.
Removing both let me compile the project without any issue
2 Views