Questions tagged [kotlin2js]

Kotlin complied to JavaScript

3 questions
6
votes
2 answers

Load resource file (json) in kotlin js

Given this code, where should I place the file.json to be able to be found in the runtime? // path: src/main/kotlin/Server.kt fun main() { val serviceAccount = require("file.json") } I tried place it under src/main/resources/ without luck. I also…
Diolor
  • 13,181
  • 30
  • 111
  • 179
5
votes
2 answers

How to fix "Its dependency 'kotlinx-coroutines-core' was not found."

I followed this tutorial to create a kotlin->js project: https://kotlinlang.org/docs/tutorials/javascript/getting-started-gradle/getting-started-with-gradle.html Next, I followed these instructions to use coroutines in my code:…
remouter
  • 73
  • 1
  • 6
1
vote
0 answers

Gradle Kotlin : How to convert kotlin2js plugin of groovy build.gradle to build.gradle.kts?

From https://kotlinlang.org/docs/tutorials/javascript/getting-started-gradle/getting-started-with-gradle.html I got the following build.gradle (groovy) script : group 'org.example' version '1.0-SNAPSHOT' buildscript { ext.kotlin_version =…
Emile Achadde
  • 1,715
  • 3
  • 10
  • 22