I have kotlin2js
plugin with task compileKotlin2Js
. I configure it like this:
val compileKotlin2Js: Kotlin2JsCompile by tasks
compileKotlin2Js.kotlinOptions {
main = "call"
outputFile = "${projectDir}/build/app.js"
}
Now I want to create similar task, but with other kotlinOptions
. For example:
.kotlinOptions {
main = "noCall"
outputFile = "${projectDir}/build/lib.js"
}
How to do it?
UPDATE: I also tried to do some thing like this:
tasks.register<Kotlin2JsCompile>("myCompile2Js") {
kotlinOptions {
main = "noCall"
outputFile = "${projectDir}/build/lib.js"
}
}
But it produce error:
Execution failed for task ':myCompile2Js'.
> lateinit property destinationDirProvider has not been initialized
I also tried to specify destinationDir
. Error disappear, but such task does not produce any build.