Hello any one found a solution to using resources ...
# javascript
a
Hello any one found a solution to using resources from a kotlin/js library???
e
You mean loading them at runtime just like in the JVM?
r
I've struggled with this problem for a long time. I've used dedicated gradle configuration to copy and use resources from published kotlin/js artifacts. But it was very complicated and had to be adjusted between Kotlin plugin releases. Finally I've decided to simply publish all the assets as a dedicated NPM module and just use a npm() dependency.
a
I think there should be a ticket for this.
@edrd Any would do really, either runtime or compile time, any would help at this moment
b
Can't you just require() them from resources?
a
you couldn't @Big Chungus, at least I tried and failed 😔
t
a
@turansky how do I use this to get resources bundled in the dependency klib?? can I get a sample?? assuming the resources are in a library at "com.example:cat-images"?
b
You cannot.bkptlin does bundle resources into klib, but doesn't expand them when importing... Might be a bug.