There are samples projects of new lib: Kotlinx-nod...
# javascript
f
There are samples projects of new lib: Kotlinx-nodejs?
Now you can only copy required sources :(
l
it works for me
Copy code
plugins {
    kotlin("js") version "1.4.0-rc"
    kotlin("plugin.serialization") version "1.4.0-rc"
    id("com.github.ben-manes.versions") version "0.29.0"
}

repositories {
    mavenLocal()
    jcenter()
    maven("<https://dl.bintray.com/kotlin/kotlin-eap>")
    maven("<https://kotlin.bintray.com/kotlinx>")
    maven("<https://kotlin.bintray.com/js-externals>")
}

dependencies {
    implementation(kotlin("stdlib-js","1.4.0-rc"))
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:1.0-M1-1.4.0-rc")
    implementation("org.jetbrains.kotlinx:kotlinx-nodejs:0.0.3")
    testImplementation(kotlin("test-js", "1.4.0-rc"))
}

kotlin {
    js {
        useCommonJs()
        //produceExecutable()
        nodejs {

        }
    }
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile>().configureEach {
    kotlinOptions {
        freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-prerelease-check")
    }
}
b
Hi! With
1.4.0-rc
you can use
0.0.4
of
kotlinx-nodejs
. For more information take a look at https://github.com/Kotlin/kotlinx-nodejs/blob/master/README.md
✔️ 3
f
@bashor THX, it already works. What advantages does it have over the previous target config? Does it replace or will it be implemented with the previous configuration in GRADLE DSL?
b
@frank @linux_china It would be better to remove
-Xskip-prerelease-check
from the config and use a version of the library built using “release” compiler. The option is not intended to use in production, it mostly used internally, e.g. while bootstrapping compiler.
👍 1