https://kotlinlang.org logo
#javascript
Title
# javascript
c

CLOVIS

08/13/2022, 10:18 PM
I added a file to the
jsMain/resources
directory of my library module, but it doesn't end up in
build/js/packages
for the final module. Is there anything needed to tell Gradle to put resources from dependencies there?
t

Tóth István Zoltán

08/14/2022, 2:20 AM
If you run a build, you will find the files in
build\distributions
. We use multiplatform and we ended up copying everything with gradle tasks into our own directory and then create the distribution zip/docker files from there. Check this template project for a working example. It builds a distribution zip and also a docker image. https://github.com/spxbhuhb/zakadabar-application-template/blob/master/buildSrc/src/main/kotlin/zakadabar/gradle/zk-build-tasks.gradle.kts
👍🏾 1
c

CLOVIS

08/14/2022, 2:21 PM
If I import the library from another project, will the files will be kept?
t

Tóth István Zoltán

08/15/2022, 3:11 AM
That is a good question, my guess is yes. But to be honest, I don't know. My resources directory is typically empty for libraries (my CSS is generated from Kotlin code). It might also depend on how you import the project. When it is imported from a repository, I guess the files will be there. You can check the JAR files in the "distributions" directory to see what's in them. These are simple ZIP files, just rename them and have a look inside.
2 Views