File tree Expand file tree Collapse file tree 5 files changed +50
-0
lines changed
Expand file tree Collapse file tree 5 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ rootProject.name = "kmp-showcase"
1919include(" :androidApp" )
2020include(" :shared" )
2121include(" :server" )
22+ include(" :web" )
2223
2324enableFeaturePreview(" GRADLE_METADATA" )
2425
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ kotlin {
2424 }
2525 }
2626 }
27+ js {
28+ browser {
29+ }
30+ }
31+
2732 sourceSets {
2833 all {
2934 languageSettings.apply {
@@ -83,6 +88,13 @@ kotlin {
8388 }
8489 }
8590 val iosTest by getting
91+
92+ val jsMain by getting {
93+ dependencies {
94+ api(Dependencies .Koin .core)
95+ api(Dependencies .Coroutines .common)
96+ }
97+ }
8698 }
8799}
88100android {
Original file line number Diff line number Diff line change 1+ plugins {
2+ kotlin(" js" )
3+ }
4+
5+ dependencies {
6+ implementation(kotlin(" stdlib-js" ))
7+ implementation(project(" :shared" ))
8+ }
9+
10+
11+ kotlin {
12+ js {
13+ useCommonJs()
14+ browser {
15+ runTask {
16+ outputFileName = " app.js"
17+ }
18+ }
19+ binaries.executable()
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ import kotlinx.browser.document
2+
3+ fun main () {
4+ document.body?.textContent = " Welcome"
5+ }
Original file line number Diff line number Diff line change 1+ <!doctype html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < title > Kotlin Multiplatform Showcase</ title >
6+ </ head >
7+ < body >
8+ < div id ="root "> </ div >
9+ < script src ="app.js "> </ script >
10+ </ body >
11+ </ html >
You can’t perform that action at this time.
0 commit comments