quiro
05/24/2024, 4:19 PM@JsExport
annotated function. The function should return the content of the file. When I package my library though, the file, stored in src/jsMain/resources/file.json
is not included in the bundle. Is there any way to include it?turansky
05/24/2024, 5:35 PMquiro
05/24/2024, 7:32 PMturansky
05/24/2024, 7:41 PMimport
function to include JSON file in bundlequiro
05/24/2024, 7:56 PMimport
and then annotate the function with @JsExport
turansky
05/24/2024, 9:09 PMimportAsync
will be fineturansky
05/24/2024, 9:12 PM@JsExport
fun getJson(): Promise<Data> {
return importAsync<Data>("./data.json")
}
// legacy
@JsExport
fun getJson(): Data {
return require<Data>("./data.json")
}