ian.shaun.thomas
11/29/2019, 5:27 PMorg.jetbrains.kotlin.js
it's pretty trivial to get the browser dev setup working with the kotlin.target.browser {}
. What's not is where to go from here. How would I package the node outputs in /build/js
to be usable as static inputs in a ktor application in a multi module project? Given the js plugin seems to properly call node under the hood I'm imagining I can call some release task but reading the plugin source I'm not seeing anything obvious and the available tasks seem to be devoid of anything that would appear to create a consolidated output I can use statically.ian.shaun.thomas
11/29/2019, 6:16 PMval taskGetJs by tasks.register<Copy>("getJs") {
val clientJsProject = project(":client:js")
dependsOn(clientJsProject.tasks.getByName("browserWebpack"))
from("${clientJsProject.buildDir}/distributions/js-$version.js")
into("$buildDir/external-resources/web")
rename { filename: String -> filename.replace("-$version", "") }
}
tasks.getByName("compileKotlin").dependsOn(taskGetJs)
most notably needing to rename the distribution to the expected file name for the index.html
this also doesn't solve copying over the resources like the index and the css either