Continous build in multiplatform project for WDS hot reloading

Hello. I managed to configure multiplatform project with JVM and JS targets with React but I can’t get it to update frontend on hot reload. When I make a change to kotlin sources I see that there is a signal emitted to the browser and the page is being refreshed, but there are no changes to the content. I tried to use --continuous option for jsRun task but it’s unknown for Gradle. I was following the guide here: https://kotlinlang.org/docs/reference/js-project-setup.html#configuring-run-task but it’s for Kotlin/JS projects, not for multiplatform projects and it seems that jsRun doesn’t work like run task from Kotlin/JS. I guess webpack is running fine with hot reloading and it’s watching my kotlin sources, but the sources are not compiled each time I make a change. How can I configure my project so that changes to the source are reflected on hot reloading?

The project is available here: https://github.com/Mesayah/kstore

1 Like

There is an example project with hot reload working:

I was able to get React front-end hot reload working with Spring Boot back-end, using Kotlin Gradle DSL: GitHub - alexoooo/sample-multiplatform-boot-react: Sample of full-stack application in Kotlin with Spring Boot back-end and React front-end

Note that the multimplatform functionality is still experimental, and there is a new IR coming which will probably require things to be done somewhat differently: https://blog.jetbrains.com/kotlin/2020/03/kotlin-1-4-m1-released/