0

For jvm i can use:

plugins {
    kotlin("jvm") version "1.2.60"
}

I have found no equivanent string for "jvm" for use with javascript and am using the following:

plugins {
    id("kotlin2js") version "1.2.60"
}

So the questions. Is there an equivalent string to "jvm" to for javascript or some other more direct equivalent to the 'kotlin("jvm")'?

innov8
  • 2,093
  • 2
  • 24
  • 31

2 Answers2

0

So the answer is taken as "not yet" - and no current plan for that to change either. So stick with the id().

innov8
  • 2,093
  • 2
  • 24
  • 31
0

It doesn't work since plugin for JS isn't published yet on Gradle Plugins Portal. Feel free to vote for the issue.

As a workaround, you can add to your settings.gradle:

pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == "kotlin2js") {
                useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
            }
        }
    }
}

And then in your build.gradle.kts files you can write like

plugins {
    id("kotlin2js") version "1.3.10"
}

repositories {
    mavenCentral()
}

dependencies {
    implementation(kotlin("stdlib-js"))
}
bashor
  • 8,073
  • 4
  • 34
  • 33