Trying to get my feet wet with kotlinjs. Here are a few things that are not so obvious that could help you.
- Make sure you use the Gradle > Kotlin Javascript. This has all the tools you need for auto reload/compile etc.
- When you run the project from Intellij, add the --continuous arguments from within IntelliJ Run. This ensures that when you do any changes, your project gets recompiled and reloaded automatically on your browser.
- Edit src/resources/index.html. The <script> tag has the bundled js code is under the head element. This will cause issue because your javascript will get executed before the whole document is rendered. Place before the end of the body closing tag.
Ref: