Add some common module, or common code somewhere, that both frontend and backend has a dependency on.
I have read these two discussions:
https://discuss.kotlinlang.org/t/kotlin-to-javascript-and-kotlin-to-jvm-servlets-in-one-project/2600
https://discuss.kotlinlang.org/t/compiling-kotlin-to-both-java-and-javascript-from-the-same-module/1944
The second one contained a link to a project which modifies the main.kotlin.srcDirs by adding project(':').file('src/main/kotlin'), this however lead me to an issue with compiler errors in IntelliJ, which can be seen here: C06A/KUrlet#1
So a clear example of how to actually share code between JS and JVM is appreciated.