October 2019
Intermediate to advanced
434 pages
11h 54m
English
To consume the JavaScript target of our shared Kotlin code, we will create a new Gradle module called :webapp and then create a simple HTML page that will consume the compiled JavaScript code. Perform the following steps for this:
root/webapp build.gradle src/main/kotlin src/index.html
apply plugin: 'kotlin2js'dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-js" implementation project(':core')}compileKotlin2Js.kotlinOptions.sourceMap = truecompileKotlin2Js.kotlinOptions.outputFile = "${projectDir}/output/js/app.js"compileKotlin2Js ...
Read now
Unlock full access