jean
11/13/2022, 9:07 PMexcept
function like so :
internal expect fun readResourceFile(resourceName: String): ByteArray
This is the jvm implementation :
actual fun readResourceFile(resourceName: String) =
File("./src/commonTest/resources/$resourceName").readBytes()
I wonder how I’m supposed to implement it for my js target? I tried to use this :
js("require('../../../resources/main/$resourceName')")
but it complains that the string must be a constant. And the return type is dynamic
which doesn’t help neitherhfhbd
11/13/2022, 9:21 PMjean
11/14/2022, 9:13 PMtasks.register<Copy>("copyJsTestResources") {
from("src/commonTest/resources")
into("build/bin/iosX64/debugTest/resources") // this is for ios, what would be the equivalent for js?
}
tasks.findByName("jsTest")!!.dependsOn("copyJsTestResources")