cafonsomota
06/14/2019, 7:14 PM- src/androidMain
- src/iOSMain
- src/jsMainand my app/build.gradle follows the same approach, having all these modules on the dependencies:
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
...
}
}
androidMain...
iOSMain...
jsMain...
at this moment I’ve managed to compile the project both for android and iOS and my js module is capable to access to commonMain (shared code).
However, it seems that I’m unable to compile the JavaScript itself 😕.
Any idea what I could be doing wrong?louiscad
06/14/2019, 7:39 PMcafonsomota
06/14/2019, 7:41 PMout/production
louiscad
06/14/2019, 8:00 PMcafonsomota
06/14/2019, 8:13 PMh0tk3y
06/17/2019, 1:38 PMjs()
target? You need to call js()
in the kotlin { ... }
scope for the plugin to setup the JS compilations.cafonsomota
06/17/2019, 2:19 PMjs()
inside kotlin {}
jsMain
jsMain {
dependencies {
//implementation kotlin('stdlib-js')
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:${versions.serialization}"
// HTTP
implementation "io.ktor:ktor-client-js:${versions.ktor}"
implementation "io.ktor:ktor-client-json:${versions.ktor}"
implementation "io.ktor:ktor-client-json-js:${versions.ktor}"
implementation "io.ktor:ktor-client-serialization-js:${versions.ktor}"
// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:${versions.coroutines}"
}
}
but now when I try to run index.html
it seems it doesn’t find the dependencies 😕