David Eriksson
07/30/2020, 5:52 PM/* Kotlin js output assumes window exists, which it won't on Workers. Hack around it */
(new File("$projectDir/index.js")).text = "const window=this; " + file("$projectDir/build/distributions/${rootProject.name}.js").getText()
How do I write this in build.gradle.kts?
File("$projectDir/index.js").text
Where .text seem to be some kind of extension to the File object that is not available in Kotlin?
PS. I don't know why they use kotlin.target.browser and not target.nodejs but maybe it is to get access to org.w3c.* stuff.
Thanks!eskatos
07/30/2020, 5:54 PMfile.text
=> file.readText()
file.text = "some"
=> file.writeText("some")
David Eriksson
07/30/2020, 5:56 PMgildor
08/04/2020, 3:58 AMkotlin.target.browser
it probably should be kotlin.target.nodejs
)
So it will not require any hacksgildor
08/04/2020, 3:59 AMDavid Eriksson
08/05/2020, 7:13 PM