Hi all, I am getting started with the kotlin toolc...
# kotlin-toolchain
g
Hi all, I am getting started with the kotlin toolchain on a new project and would like to run my wasm-js app in development mode so it will hot reload. I have installed the latest dev build. What do I need to pass in the run configuration to turn that on?
a
Hi, I think we don't support live-autoreload yet But you can start it manually and point to the build dir (where there bundled js app lives in
build
folder)
Copy code
npx live-server <folder>
and if you need a browser support (browser listens to the events from the reload server and reloads the page), it's more complicated you can add your own
index.html
into the
resources/
folder of the web app, and when we build we will pick it up and inside this
index.html
you can place some snippet like that:
Copy code
<script>
  const ws = new WebSocket("<ws://localhost:35729>");
  ws.onmessage = (event) => {
    if (event.data === "reload") {
      window.location.reload();
    }
  };
</script>
or just wait until we support that automatically out of box, let me create an YT ticket
g
Thanks! I will try this out. Also, for some feedback on the toolchain and its CLI. It is such a better experience than Gradle, even now in alpha. Its so much more straight forward and easy to configure. This is exactly what Kotlin and KMP needed.
💜 5