Why is the yarn.lock file crated when building JVM project that uses a multiplatform library?

Hi everyone, I need some help understanding how local multiplatform libraries are built when we build our project.

Our current set-up is:

  • We have a multiplatform library that we develop internally, which has targets for JVM and JS.
  • We have a server project that uses the library mentioned above and is developed using Kotlin/JVM.
  • We have a web app that also uses the library mentioned above and is developed using Kotlin/JS.

When we build the web app using ./gradlew build the kotlin-js-store/yarn.lock file is created, which makes sense.

However, when we build the server using ./gradlew build then the kotlin-js-store/yarn.lock file is also created, even though the server code is 100% Kotlin/JVM.

My assumption is that the JS part of the multiplatform library is being built when we build the server, but shouldn’t that be skipped autoamtically?My questions are:

  1. Is the assumption above correct? Or is there something I’m missing?
  2. Should we keep building the server using ./gradlew build or should we use a different Gradle task for this that doesn’t build the JS code in the multiplatform library?

Thanks for the help!